Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active January 10, 2017 23:03
Show Gist options
  • Select an option

  • Save gregjhogan/a41281f22ee01d1fee4c to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/a41281f22ee01d1fee4c to your computer and use it in GitHub Desktop.
Azure CLI create group and deploy from template
azure group create <resource-group> <location>
# create storage account for new vm vhds
azure storage account create --location <location> --type GRS --resource-group <resource-group> <name>
# get connection string(s) for following commands
azure storage account connectionstring show --resource-group <resource-group> <name>
azure storage container create --connection-string '<dest-cxn>' vhd-base-images
# copy blob from base image storage account to resource group that new vm will be in
azure storage blob copy start --connection-string '<source-cxn>' --source-container vhd-base-images --source-blob <disk.vhd> --dest-connection-string '<dest-cxn>' --dest-container vhd-base-images
# watch copy progress
azure storage blob copy show --connection-string '<dest-cxn>' --container vhd-base-images --blob <disk.vhd>
azure group deployment create --template-file <template.json> --parameters-file <parameters.json> <resource-group> <deployment-name>
azure group log show -l <resource-group>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment