This project is a proof of concept to provision a Windows VM with Git and Docker in Azure.
- Install Azure CLI – https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
service-pricipal.shto create a Service Account
quickstart.authfile will be created that contains environment variables needed for authentication/authorization
- For resource management I prepended resources with
ccaspanelloplease change this to be your last name
Set the following environment variables. Values on the right are from the
quickstart.auth file previously mentioned.
AZURE_CLIENT_ID = clientId AZURE_CLIENT_SECRET = clientSecret AZURE_TENANT_ID = tenantId AZURE_SUBSCRIPTION_ID = subscriptionId
Then run the application
go run main.go
You can also debug this in your favorite IDE of choice
Useful Azure CLI Commands
To delete the resource group
az group delete --resource-group ccaspanello-sandbox
Things to Consider
This prototype uses the Azure Go SDK to create different resources; however, the CLI can use a template.json file to do the same thing. We should see if the Go SDK provides a way to use a template file or byte stream which may simplify code and reduce the number of API calls needed.