Lab 4
Lab 4
Lab 4
Lab introduction
In this lab, you learn about Azure web apps. You learn to configure a web app to display a
Hello World application in an external GitHub repository.
This lab requires an Azure subscription. Your subscription type may affect the availability of
features in this lab. You may change the region, but the steps are written using East US.
Architecture diagram
Job skills
Task 1: Create and configure an Azure web app.
Task 2: Create and configure a deployment slot.
Task 3: Configure web app deployment settings.
Task 4: Swap deployment slots.
Task 5: Configure and test autoscaling of the Azure web app.
Task 1: Create and configure an Azure web app
In this task, you create an Azure web app. Azure App Services is a Platform As a Service
(PAAS) solution for web, mobile, and other web-based applications. Azure web apps is part
Azure App Services hosting most runtime environments, such as PHP, Java, and .NET. The
app service plan that you select determines the web app compute, storage, and features.
3. Select + Create, from drop-down menu, Web App. Notice the other choices.
4. On the Basics tab of the Create Web App blade, specify the following settings
(leave others with their default values):
Setting Value
Publish Code
Region East US
1. On the blade of the newly deployed Web App, click the Default domain link to
display the default web page in a new browser tab.
2. Close the new browser tab and, back in the Azure portal, in the Deployment section
of the Web App blade, click Deployment slots.
Note: The Web App, at this point, has a single deployment slot labeled PRODUCTION.
3. Click Add slot, and add a new slot with the following settings:
Setting Value
Name staging
4. Select Add.
5. Back on the Deployment slots blade of the Web App, click the entry representing the
newly created staging slot.
Note: This will open the blade displaying the properties of the staging slot.
6. Review the staging slot blade and note that its URL differs from the one assigned to
the production slot.
Note: Make sure you are on the staging slot blade (instead than the production slot).
2. In the Source drop-down list, select External Git. Notice the other choices.
5. Select Save.
7. Select the Default domain link, and open the URL in a new tab.
Note: The deployment may take a minute. Be sure to Refresh the application page.
1. Navigate back to the Deployment slots blade, and then select Swap.
3. On the Overview blade of the Web App select the Default domain link to display
the website home page.
4. Verify the production web page displays the Hello World! page.
Note: Copy the Default domain URL you will need it for load testing in the next task.
Note: Ensure you are working on the production slot not the staging slot.
2. From the Scaling section, select Automatic. Notice the Rules Based option. Rules
based scaling can be configured for different app metrics.
6. In the Load Test your App box, select Create Load Test.
o Select + Create and give your load test a name. The name must be unique.
o Select Review + create and then Create.
7. Wait for the load test to create, and then select Go to resource.
9. On the Test plan tab, click Add request. In the URL field, paste in your Default
domain URL. Ensure this is properly formatted and begins with https://.
11. Review the test results including Virtual users, Response time, and Requests/sec.
In the Azure portal, select the resource group, select Delete the resource
group, Enter resource group name, and then click Delete.
Using Azure PowerShell, Remove-AzResourceGroup -Name resourceGroupName.
Using the CLI, az group delete --name resourceGroupName.
Key takeaways
Congratulations on completing the lab. Here are the main takeaways for this lab.
Azure App Services lets you quickly build, deploy, and scale web apps.
App Service includes support for many developer environments including ASP.NET,
Java, PHP, and Python.
Deployment slots allow you to create separate environments for deploying and testing
your web app.
You can manually or automatically scale a web app to handle additional demand.
A wide variety of diagnostics and testing tools are available.