Skip to content

Instantly share code, notes, and snippets.

@dfinke
Last active December 19, 2018 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfinke/91b36a39f001812a5ca023d4a1d5ccf1 to your computer and use it in GitHub Desktop.
Save dfinke/91b36a39f001812a5ca023d4a1d5ccf1 to your computer and use it in GitHub Desktop.
How do you translate these `az cli` calls into the PowerShell Az Module?
az login --service-principal --username "${SERVICE_PRINCIPAL}" --password "${SERVICE_PASS}" --tenant "${TENANT_ID}"
echo "Creating resource group ${APPID}-group"
az group create -n ${APPID}-group -l eastus
echo "Creating app service plan ${APPID}-plan"
az appservice plan create -g ${APPID}-group -n ${APPID}-plan --sku FREE
echo "Creating webapp ${APPID}"
az webapp create -g ${APPID}-group -p ${APPID}-plan -n ${APPID} --deployment-local-git
echo "Getting username/password for deployment"
DEPLOYUSER=`az webapp deployment list-publishing-profiles -n ${APPID} -g ${APPID}-group --query '[0].userName' -o tsv`
DEPLOYPASS=`az webapp deployment list-publishing-profiles -n ${APPID} -g ${APPID}-group --query '[0].userPWD' -o tsv`
git remote add azure https://${DEPLOYUSER}:${DEPLOYPASS}@${APPID}.scm.azurewebsites.net/${APPID}.git
git push azure master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment