Azure Sandbox

This project is a proof of concept to provision a Windows VM with Git and Docker in Azure.

Prerequisites

  • Install Azure CLI – https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
  • Run service-pricipal.sh to create a Service Account
    • A quickstart.auth file will be created that contains environment variables needed for authentication/authorization
  • For resource management I prepended resources with ccaspanello please change this to be your last name

Running

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.

GitHub

View Github