A set of Azure Functions to setup Azure DevOps Build Agents just in time using Azure Container Instances.
ToDo: Add a Intoduction to project and explaint setup process.
To create an Azure Container Instance with an Azure Function call the SetupAzureDevOpsBuildAgent
Function and include a Json body with the following content:
{
"SubscriptionId": "<SubscriptionId>",
"ResourceGroupName": "<ResourceGroupName>",
"AzureRegion": "Westeurope",
"ContainerInstanceName": "<ContainerInstanceName>",
"RegistrySettings":{
"LoginServer":"<PrivateRegistryLoginServer>",
"Username": "<Username>",
"Password": "<Password>"
},
"ContainerSettings":{
"DockerImageName": "<DockerImage>",
"ExternalTcpPort": "<PortToExposeIfNeededAsInt>",
"CpuCoreCount": "<CpuCoresAsDouble>",
"MemorySizeInGb": "<MemorySizeInGbInInt>",
"DnsPrefix": "<dnsPrefix>"
},
"BuildMetaData": {
"PlanUrl": "TagValue1",
"ProjectId": "TagValue2",
"RandomTag": "Value"
}
}
BuildMetaDataSection
will be used for KeyValue tagging the ACI resource in Azure for easier management. I recommend to pass Azure DevOps build information.
curl --request POST \
--url http://localhost:7071/api/SetupAzureDevOpsBuildAgent \
--header 'content-type: application/json' \
--data '{
"SubscriptionId": "<SubscriptionId>",
"ResourceGroupName": "<ResourceGroupName>",
"AzureRegion": "Westeurope",
"ContainerInstanceName": "<ContainerInstanceName>",
"RegistrySettings":{
"LoginServer":"<PrivateRegistryLoginServer>",
"Username": "<Username>",
"Password": "<Password>"
},
"ContainerSettings":{
"DockerImageName": "<DockerImage>",
"ExternalTcpPort": "<PortToExposeIfNeededAsInt>",
"CpuCoreCount": "<CpuCoresAsDouble>",
"MemorySizeInGb": "<MemorySizeInGbInInt>",
"DnsPrefix": "<dnsPrefix>"
},
"BuildMetaData": {
"PlanUrl": "TagValue1",
"ProjectId": "TagValue2",
"RandomTag": "Value"
}
}'
- Microsoft Azure - As main Cloud Environment
- Azure Functions - Main Entrypoint for REST Clients and Connector to Azure IoT Central
Documentation in Detail will (hopefully) follow soon!
ToDo: Add what things you need to install the software and how to install them
ToDo: Add deployment details
- Azure Functions - Serverless Framework which can be triggered by Azure DevOps
- .NET Core - The Framework used to build the Device Client software
- Alexander Beck - Initial work - abeckdev
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details