|
1 | 1 | ---
|
2 |
| -author: DavidCBerry13 |
3 |
| -ms.author: daberry |
| 2 | +author: charris-msft |
| 3 | +ms.author: charris |
4 | 4 | ms.topic: include
|
5 |
| -ms.date: 01/29/2022 |
| 5 | +ms.date: 04/01/2022 |
6 | 6 | ---
|
7 |
| -Azure CLI commands can be run in the [Azure Cloud Shell](https://shell.azure.com) or on a workstation with the [Azure CLI installed](/cli/azure/install-azure-cli). |
8 |
| - |
9 |
| -First, create a resource group to act as a container for all of the Azure resources related to this application. |
10 |
| - |
11 |
| -#### [bash](#tab/terminal-bash) |
12 |
| - |
13 |
| -```azurecli |
14 |
| -# Use 'az account list-locations --output table' to list locations |
15 |
| -LOCATION='eastus' |
16 |
| -RESOURCE_GROUP_NAME='msdocs-python-webapp-quickstart' |
17 |
| -
|
18 |
| -az group create \ |
19 |
| - --location $LOCATION \ |
20 |
| - --name $RESOURCE_GROUP_NAME |
21 |
| -``` |
22 |
| - |
23 |
| -#### [PowerShell terminal](#tab/terminal-powershell) |
24 |
| - |
25 |
| -```azurecli |
26 |
| -# Use 'az account list-locations --output table' to list locations |
27 |
| -$LOCATION='eastus' |
28 |
| -$RESOURCE_GROUP_NAME='msdocs-python-webapp-quickstart' |
29 |
| -
|
30 |
| -# Create a resource group |
31 |
| -az group create ` |
32 |
| - --location $LOCATION ` |
33 |
| - --name $RESOURCE_GROUP_NAME |
34 |
| -``` |
35 |
| - |
36 |
| ---- |
37 |
| - |
38 |
| -Next, create an App Service plan using the [az appservice plan create](/cli/azure/appservice/plan#az-appservice-plan-create) command. |
39 |
| - |
40 |
| -* The `--sku` parameter defines the size (CPU, memory) and cost of the app service plan. This example uses the B1 (Basic) service plan, which will incur a small cost in your Azure subscription. For a full list of App Service plans, view the [App Service pricing](https://azure.microsoft.com/pricing/details/app-service/linux/) page. |
41 |
| -* The `--is-linux` flag selects the Linux as the host operating system. |
42 |
| - |
43 |
| -#### [bash](#tab/terminal-bash) |
44 |
| - |
45 |
| -```azurecli |
46 |
| -APP_SERVICE_PLAN_NAME='msdocs-python-webapp-quickstart' |
47 |
| -
|
48 |
| -az appservice plan create \ |
49 |
| - --name $APP_SERVICE_PLAN_NAME \ |
50 |
| - --resource-group $RESOURCE_GROUP_NAME \ |
51 |
| - --sku B1 \ |
52 |
| - --is-linux |
53 |
| -``` |
54 |
| - |
55 |
| -#### [PowerShell terminal](#tab/terminal-powershell) |
56 |
| - |
57 |
| -```azurecli |
58 |
| -$APP_SERVICE_PLAN_NAME='msdocs-python-webapp-quickstart' |
59 |
| -
|
60 |
| -az appservice plan create ` |
61 |
| - --name $APP_SERVICE_PLAN_NAME ` |
62 |
| - --resource-group $RESOURCE_GROUP_NAME ` |
63 |
| - --sku B1 ` |
64 |
| - --is-linux |
65 |
| -``` |
66 |
| - |
67 |
| ---- |
68 |
| - |
69 |
| -Finally, create the App Service web app using the [az webapp create](/cli/azure/webapp#az-webapp-create) command. |
70 |
| - |
71 |
| -* The *app service name* is used as both the name of the resource in Azure and to form the fully qualified domain name for your app in the form of `https://<app service name>.azurewebsites.com`. |
72 |
| -* The runtime specifies what version of Python your app is running. This example uses Python 3.9. To list all available runtimes, use the command `az webapp list-runtimes --os linux --output table`. |
73 |
| - |
74 |
| -#### [bash](#tab/terminal-bash) |
75 |
| - |
76 |
| -```azurecli |
77 |
| -# Change 123 to any three characters to form a unique name across Azure |
78 |
| -APP_SERVICE_NAME='msdocs-python-webapp-quickstart-123' |
79 |
| -
|
80 |
| -az webapp create \ |
81 |
| - --name $APP_SERVICE_NAME \ |
82 |
| - --runtime 'PYTHON|3.9' \ |
83 |
| - --plan $APP_SERVICE_PLAN_NAME \ |
84 |
| - --resource-group $RESOURCE_GROUP_NAME \ |
85 |
| - --query 'defaultHostName' \ |
86 |
| - --output table |
87 |
| -``` |
88 |
| - |
89 |
| -#### [PowerShell terminal](#tab/terminal-powershell) |
90 |
| - |
91 |
| -```azurecli |
92 |
| -# Change 123 to any three characters to form a unique name across Azure |
93 |
| -$APP_SERVICE_NAME='msdocs-python-webapp-quickstart-123' |
94 |
| -
|
95 |
| -az webapp create ` |
96 |
| - --name $APP_SERVICE_NAME ` |
97 |
| - --runtime 'PYTHON:3.9' ` |
98 |
| - --plan $APP_SERVICE_PLAN_NAME ` |
99 |
| - --resource-group $RESOURCE_GROUP_NAME ` |
100 |
| - --query 'defaultHostName' ` |
101 |
| - --output table |
102 |
| -``` |
| 7 | +Azure CLI has a command `az webapp up` that will create the necessary resources and deploy your application in a single step. You don't need to create the resources separately so you can move on to [**Step 3 - Deploy your application code to Azure**](#3---deploy-your-application-code-to-azure) and select the _Deploy using Azure CLI_ tab. |
103 | 8 |
|
104 | 9 | ---
|
0 commit comments