Question 14 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 14 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - A company is developing a Java web app.

The web app code is hosted in a GitHub repository located at https://github.com/Contoso/webapp.

The web app must be evaluated before it is moved to production.

You must deploy the initial code release to a deployment slot named staging.

You need to create the web app and deploy the code.

How should you complete the commands? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

gitrepo=https://github.com/Contosohwebapp
webappname=businesswebapp
resourcegroupname=BusinessAppResourceGroup

az

vv

‘group
webapp

appservice plan

webapp deployment slot
webapp deployment source

create —location centralus name Sresourcegroupname

create name Swebappname --resource-group Sresourcegroupname —sku S3

create -name $webappname —resource-group $resourcegroupname plan Swebappname

create ~name $webappname --resource-group Sresourcegroupname ~-slot staging

config name Swebappname —resource-group $resourcegroupname \
slot staging —repo-url Sgitrepo ~branch master —manual-integration

Explanations

Answer Area

gitrepo=https://github.com/Contosohwebapp
webappname=businesswebapp

resourcegroupname=BusinessAppResourceGroup
az LY. create ~location centralus -name Sresourcegroupname

az [LV create name Swebappname --resource-group Sresourcegroupname —sku S3

az l create —name $webappname —resource-group $resourcegroupname --plan Swebappname

az [1¥__ create -name Swebappname -resource-group Sresourcegroupname ~slot staging

az Lv, config -name Swebappname --resource-group Sresourcegroupname \
slot staging —repo-url Sgitrepo ~branch master —manual-integration

Box 1: group - # Create a resource group.

az group create --location westeurope --name myResourceGroup Box 2: appservice plan - # Create an App Service plan in STANDARD tier (minimum required by deployment slots)

az appservice plan create --name $webappname --resource-group myResourceGroup --sku S1 Box 3: webapp - # Create a web app.

az webapp create --name $webappname --resource-group myResourceGroup \ --plan $webappname Box 4: webapp deployment slot - #Create a deployment slot with the name "staging"

az webapp deployment slot create --name $webappname --resource-group myResourceGroup \ --slot staging Box 5: webapp deployment source - # Deploy sample code to "staging" slot from GitHub.

az webapp deployment source config --name $webappname --resource-group myResourceGroup \ --slot staging --repo-url $gitrepo --branch master --manual-integration Reference: https://docs.microsoft.com/en-us/azure/app-service/scripts/cli-deploy-staging-environment.