Azure notes

From Federal Burro of Information
Jump to navigationJump to search

modern login process:

https://docs.microsoft.com/en-us/powershell/azureps-cmdlets-docs/

sample deployment bash:

#!/bin/sh

# how I was doing it:
# azure group deployment create --mode Complete -f website_template.json -e website_parameters.json -g websiteRG2 -n deployment1

deploymentName="deployment1"
resourceGroupName="websiteRG2"
templateFilePath="website_template.json"
parametersFilePath="website_parameters.json"

# how the supplied deploy.sh does it:
echo azure group deployment create --name $deploymentName --resource-group $resourceGroupName --template-file $templateFilePath --parameters-file $parametersFilePath
azure group deployment create --name $deploymentName --resource-group $resourceGroupName --template-file $templateFilePath --parameters-file $parametersFilePath

Script to validate you files before deploying or actualy doing stuff:

#!/bin/sh

echo website_parameters.json
python -mjson.tool < website_parameters.json >> /dev/null || exit && echo result $?
echo website_template.json
python -mjson.tool < website_template.json >> /dev/null || exit && echo result $?

azure group template validate -f website_template.json  -e website_parameters.json -g websiteRG

# azure group deployment create  --mode Complete    -f my_website.json -e my_website_params.json -g websiteRG -n mydeployment
# azure group deployment create  --mode Incremental -f my_website.json -e my_website_params.json -g websiteRG -n devdeployment3