Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit e83311b

Browse files
authored
Simplifying lab 11A's instructions
Removed the reference to the resource creation from portal and replaced it with Azure CLI commands. This will simplify the deployment since the old `WebApp + SQL` is now removed from the portal
1 parent ca22795 commit e83311b

1 file changed

Lines changed: 74 additions & 44 deletions

File tree

Instructions/Labs/AZ400_M11_Configuring_Pipelines_as_Code_with_YAML.md

Lines changed: 74 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -74,43 +74,80 @@ In this task, you will use Azure DevOps Demo Generator to generate a new project
7474
In this task, you will create an Azure web app and an Azure SQL database by using the Azure portal.
7575

7676
1. From the lab computer, start a web browser, navigate to the [**Azure Portal**](https://portal.azure.com), and sign in with the user account that has the Owner role in the Azure subscription you will be using in this lab and has the role of the Global Administrator in the Azure AD tenant associated with this subscription.
77-
1. In the Azure portal, click the icon consisting of three horizontal lines in the upper left corner of the page and, in the hub menu and click **+ Create a resource**.
78-
1. On the **New** blade, in the search text box, type **Web App + SQL** and press the **Enter** key.
79-
1. On the **Web App + SQL**, click **Create**.
80-
1. On the **Web App + SQL** blade, specify the following settings:
81-
82-
| Setting | Value |
83-
| --- | --- |
84-
| App name | any valid, globally unique DNS host name |
85-
| Subscription | the name of the Azure subscription you are using in this lab |
86-
| Resource group | the name of a new resource group **az400m11l01-RG** |
87-
88-
1. Click **App Service plan/Location**, on the **App Service plan** blade, click **+ Create new**.
89-
1. On the **New App Service Plan** blade, specify the following settings and click **OK**:
90-
91-
| Setting | Value |
92-
| --- | --- |
93-
| App service plan | any valid name |
94-
| Location| the name of the Azure region where you want to deploy resources you will be using in this lab |
95-
| Pricing tier | **D1 Shared** |
96-
97-
1. Back on the **Web App + SQL** blade, click **SQL Database**.
98-
1. On the **SQL Database** blade, in the **Name** textbox, type **partsunlimited**.
99-
1. On the **SQL Database** blade, click **Target server**.
100-
1. On the **New server** blade, specify the following settings and click **Select**:
101-
102-
| Setting | Value |
103-
| --- | --- |
104-
| Server name | any valid, globally unique DNS host name |
105-
| Server admin login | Student |
106-
| Password | Pa55w.rd1234 |
107-
| Location | the name of the Azure region that you chose for the App Service plan |
108-
| Allow Azure services to access server | enabled |
109-
110-
1. Back on the **SQL Database** blade, click **Select**.
111-
1. Back on the **Web App + SQL** blade, click **Create**.
112-
113-
> **Note**: Wait for the process to complete. This should take about 2 minutes.
77+
1. In the Azure portal, in the toolbar, click the **Cloud Shell** icon located directly to the right of the search text box.
78+
1. If prompted to select either **Bash** or **PowerShell**, select **Bash**.
79+
80+
>**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and select **Create storage**.
81+
82+
1. From the **Bash** prompt, in the **Cloud Shell** pane, run the following command to create a resource group (replace the `<region>` placeholder with the name of the Azure region closest to you such as 'eastus').
83+
84+
```bash
85+
RESOURCEGROUPNAME='az400m11l01-RG'
86+
LOCATION='<region>'
87+
az group create -n $RESOURCEGROUPNAME -l $LOCATION
88+
```
89+
90+
1. To create a Windows App service plan by running the following command:
91+
92+
```bash
93+
SERVICEPLANNAME='az400l11a-sp1'
94+
az appservice plan create -g $RESOURCEGROUPNAME -n $SERVICEPLANNAME --sku S1
95+
```
96+
> **Note**: If the `az appservice plan create` command fails with an error message starting with `ModuleNotFoundError: No module named 'vsts_cd_manager'`, then run the following commands and then re-run the failed command.
97+
98+
```bash
99+
az extension remove -n appservice-kube
100+
az extension add --yes --source "https://aka.ms/appsvc/appservice_kube-latest-py2.py3-none-any.whl"
101+
```
102+
103+
1. Create a web app with a unique name.
104+
105+
```bash
106+
WEBAPPNAME=partsunlimited$RANDOM$RANDOM
107+
az webapp create -g $RESOURCEGROUPNAME -p $SERVICEPLANNAME -n $WEBAPPNAME
108+
```
109+
110+
> **Note**: Record the name of the web app. You will need it later in this lab.
111+
112+
1. Next, create an Azure SQL Server.
113+
114+
```bash
115+
USERNAME="Student"
116+
SQLSERVERPASSWORD="Pa55w.rd1234"
117+
SERVERNAME="partsunlimitedserver$RANDOM"
118+
119+
az sql server create --name $SERVERNAME --resource-group $RESOURCEGROUPNAME \
120+
--location $LOCATION --admin-user $USERNAME --admin-password $SQLSERVERPASSWORD
121+
```
122+
123+
1. The web app needs to be able to access the SQL server, so we need to allow access to Azure resources in the SQL Server firewall rules.
124+
125+
```bash
126+
STARTIP="0.0.0.0"
127+
ENDIP="0.0.0.0"
128+
az sql server firewall-rule create --server $SERVERNAME --resource-group $RESOURCEGROUPNAME \
129+
--name AllowAzureResources --start-ip-address $STARTIP --end-ip-address $ENDIP
130+
```
131+
132+
1. Now create a database within that server.
133+
134+
```bash
135+
az sql db create --server $SERVERNAME --resource-group $RESOURCEGROUPNAME --name PartsUnlimited \
136+
--service-objective S0
137+
```
138+
139+
1. The web app you created needs the database connection string in its configuration, so run the following commands to prepare and add it to the app settings of the web app.
140+
141+
```bash
142+
CONNSTRING=$(az sql db show-connection-string --name PartsUnlimited --server $SERVERNAME \
143+
--client ado.net --output tsv)
144+
145+
CONNSTRING=${CONNSTRING//<username>/$USERNAME}
146+
CONNSTRING=${CONNSTRING//<password>/$SQLSERVERPASSWORD}
147+
148+
az webapp config connection-string set --name $WEBAPPNAME --resource-group $RESOURCEGROUPNAME \
149+
-t SQLAzure --settings "DefaultConnectionString=$CONNSTRING"
150+
```
114151

115152
### Exercise 1: Configure CI/CD Pipelines as Code with YAML in Azure DevOps
116153

@@ -312,13 +349,6 @@ In this task, you will add continuous delivery to the YAML-based definition of t
312349
#### Task 4: Review the deployed site
313350

314351
1. Switch back to web browser window displaying the Azure portal and navigate to the blade displaying the properties of the Azure web app.
315-
1. On the Azure web app blade, in the **Settings** section, select **Configuration**.
316-
1. On the Azure web app configuration blade, in the **Connection strings** section, click the **defaultConnection** entry.
317-
1. On the **Add/Edit connection string** blade, in the **Name** textbox, change the current value to **DefaultConnectionString**, which is the key expected by the application, and click **OK**.
318-
319-
> **Note**: This will enable the application to connect to the database created for the app service.
320-
321-
1. Back on the Azure web app configuration blade, click **Save** to apply the changes and, when prompted, click **Continue**
322352
1. On the Azure web app blade, click **Overview** and, on the overview blade, click **Browse** to open your site in a new web browser tab.
323353
1. Verify that the deployed site loads as expected in the new browser tab.
324354

0 commit comments

Comments
 (0)