General

Home > Azure > General

Table of Contents

  1. CLI

CLI

Create Resource group

Documentation available here.

Example to create a resource group

az group create --name MyTestResourceGroup --location "francecentral"

To get the list of resource groups:

az group list

Create Hosting plan

Documentation available here.

Example to create an app service plan

az appservice plan create --name MyFreeAppServicePlan --resource-group MyTestResourceGroup  --location "francecentral" --sku FREE

To get the list of app service plans:

az appservice plan list

Create Web App

Documentation available here.

Example to create a web app

az webapp create --name MyAwesomeWebApp --resource-group MyTestResourceGroup --plan MyFreeAppServicePlan
az webapp deployment list-publishing-profiles --name MyAwesomeWebApp --resource-group MyTestResourceGroup

Package and Deploy a .NET Framework Web App

Create a package using msbuild.

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" MyTestWebApplication.csproj /t:package /p:Configuration=Release

Deploy the package using deploy.cmd file and information in deployment profile (site name and password).

"obj\Release\Package\MyTestWebApplication.deploy.cmd" /y /M:https://myawesomewebapp.scm.azurewebsites.net/msdeploy.axd /U:$MyAwesomeWebApp /P:enterpasswordhere /A:Basic "-setParam:name='IIS Web Application Name',value='MyTestWebApplication'"

SQL

 az sql server create --name my-awesome-sql-server-dev01 --resource-group MyTestResourceGroup --location "francecentral" --admin-user **** --admin-password ****
az sql server firewall-rule create --resource-group MyTestResourceGroup --server my-awesome-sql-server-dev01 -n AllowAllIp --start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255
az sql db create --resource-group MyTestResourceGroup --server my-awesome-sql-server-dev01 --name myAwesomeDatabase01 --service-objective Basic