0% found this document useful (0 votes)
12 views2 pages

Azure Web Apps with Linux & Docker

Uploaded by

hadhemi riahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Azure Web Apps with Linux & Docker

Uploaded by

hadhemi riahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Using Azure Web Apps with Containers, Linux, and Cloud Shell

Introduction
In this lab, you will gain experience using the Azure Cloud Shell to create App
Service plans using Linux, and web apps that use Docker containers.
You will use the Azure Cloud Shell to create a Linux App Service plan, and a web
app under that plan which uses Docker images on DockerHub and GitHub. When
you're finished, you will browse to your site to see everything running, and will
verify all the resources you created using the Azure Portal.
Getting Started
Log in to the Azure Portal using the credentials and link provided in
the Credentials section on the hands-on lab page.
Use Cloud Shell to Create and Update Linux App Service Plans and Web
Apps
Use Cloud Shell to Create a Linux App Service Plan
Right-click the Azure Portal tab in your browser and choose the Duplicate
Tab option. In this new tab, open the Azure Cloud Shell using the icon in the
top menu.
Choose PowerShell when you are prompted. For our storage options,
choose Show advanced settings.
Ensure that the following fields are provided for the advanced settings:
 Cloud Shell region: Use the same region as the existing storage
account
 Storage Account: Click Use existing
 File Share: Click Create new and use any random name
With these options configured, click Create Storage.
Copy the PowerShell commands below and paste them into your Cloud Shell
window:
$resourceGroup = az group list --query '[0].name' -otsv
$appServicePlan = 'Linux-App-ServicePlan'

az appservice plan create -g $resourceGroup -n $appServicePlan --is-linux --


number-of-workers 1 --sku B1
Use Cloud Shell to Create a Web App Using a DockerHub Container
Image
Copy the PowerShell commands below and paste them into your Cloud Shell
window:
$app = 'LinuxDockerApp' + (Get-Date).ticks
az webapp create --resource-group $resourceGroup --plan $appServicePlan --
name $app --deployment-container-image-name
mcr.microsoft.com/dotnet/samples:aspnetapp
Use Cloud Shell to Update a Web App Container Image from DockerHub
to GitHub
Copy the PowerShell command below and paste it into your Cloud Shell window:
az webapp config container set --resource-group $resourceGroup --name $app --
docker-registry-server-url
'https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp'
We can verify that this command ran successfully by navigating back to the
Azure Portal. Go to your All Resources section of the Azure Portal. Select the App
Service named LinuxDockerApp[some numbers]. In the Settings section, click
Configuration. In the Application settings tab, you'll see
'DOCKER_REGISTRY_SERVER_URL.' Click the text 'Hidden value. Click to show
value.' If you make the value column view larger, you'll see the same URL we
provided in our command.
We can verify that our site is running by clicking Overview in the App Service
menu. Our endpoint is shown in the URL section on this page. Click on this URL to
load our app and verify that it is running. Note: the web site has changed from
what is shown in the video.
Conclusion
Congratulations on completing this hands-on lab!

You might also like