-
Install Azure-cli MSI [https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest]
-
Open GitBash
-
Try az.cmd. It should start.
-
Writing az.cmd every time is BS. Create a bash alias:
$ alias az='az.cmd'
First understand: there's a resource group, where you group all the services you really use: like webapps, api's and so on. And this resource group needs a Plan (mainly a money plan as I understood) related to pricing.
So, using our azure-cli:
$ az group create --name myResourceGroup --location westus
The following is a free plan:
$ az appservice plan create --name myPlan --sku F1
In this case a webapp, which we'll associate it to our plan and our resource group:
$ az webapp create --name myExpressApp-chrisdias --plan myPlan --runtime "node|6.9" --resource-group myResourceGroup21980742198476219
If you don't know resource group id, just ask for it:
$ az group list
And look for the one you are interested, then take the id.
$ az webapp browse --name myExpressApp-chrisdias
Use Git for deployment. Get git url:
$ az webapp deployment source config-local-git --name myExpressApp-chrisdias
It must return an URL.
Take that url and set it as azure remote:
$ git remote add azure https://chrisdias@myexpressapp-chrisdias.scm.azurewebsites.net/myExpressApp-chrisdias.git
Now if you do git push azure master it won't work because credentials for Git repo are not set up. NOTE THAT AZURE CREDENTIALS AND GIT CREDENTIALS ARE DIFFERENT!
Just use:
$ az webapp deployment user set --user-name <UserName> --password <Password>