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

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

Question

HOTSPOT - A company is developing a Node.js web app.

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

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

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

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/TailSpinToys/webapp”
$webappname="TailSpinToysWeb"
$location="WestUS2"

‘y _-Name myResourceGroup -Location $location

New-AzWebAppSlot
New-AzWebApp

New-AzAppServicePlan
New-AzResourceGroup

‘y_-Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Standard

New-AzWebAppSlot
New-AzWebApp

New-AzAppServicePlan
New-AzResourceGroup

‘W_ -Name $webappname -Location $location -AppServicePlan $webappname -ResourceGroupName myResourceGroup

New-AzWebAppSlot
New-AzWebApp

New-AzAppServicePlan
New-AzResourceGroup

‘Ww  -Name $webappname -ResourceGroupName myResourceGroup -Slot review

New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup

$PropertiesObject = @{repoUrl = "$gitrepo";branch = "master";}

Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName myResourceGroup -ResourceType
Microsoft. Web/sites/slots/sourcecontrols -ResourceName $webappname/review/web -ApiVersion 2015-08-01 -Force
‘Switch-AzWebAppSlot -Name $webappname -ResourceGroupName myResourceGroup

-SourceSlotName review -DestinationSlotName production

Explanations

Answer Area

$gitrepo="https://github.com/TailSpinToys/webapp”
$webappname="TailSpinToysWeb"

$location="WestUS2"

‘y _-Name myResourceGroup -Location $location
New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup

‘y_-Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Standard

New-AzWebAppSlot
New-AzWebApp __

New-AzAppServicePlan
New-AzResourceGroup

‘W_ -Name $webappname -Location $location -AppServicePlan $webappname -ResourceGroupName myResourceGroup

New-AzWebAppSlot
New-AzAppServicePlan
New-AzResourceGroup

-Name $webappname -ResourceGroupName myResourceGroup -Slot review

New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup

$PropertiesObject = @{repoUrl = "$gitrepo";branch = "master”;}

Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName myResourceGroup -ResourceType
Microsoft. Web/sites/slots/sourcecontrols -ResourceName $webappname/review/web -ApiVersion 2015-08-01 -Force
‘Switch-AzWebAppSlot -Name $webappname -ResourceGroupName myResourceGroup

-SourceSlotName review -DestinationSlotName production

Box 1: New-AzResourceGroup - The New-AzResourceGroup cmdlet creates an Azure resource group.

Box 2: New-AzAppServicePlan - The New-AzAppServicePlan cmdlet creates an Azure App Service plan in a given location Box 3: New-AzWebApp - The New-AzWebApp cmdlet creates an Azure Web App in a given a resource group Box 4: New-AzWebAppSlot - The New-AzWebAppSlot cmdlet creates an Azure Web App slot.

https://docs.microsoft.com/en-us/powershell/module/az.resources/new-azresourcegroup?view=azps-2.3.2 https://docs.microsoft.com/en-us/powershell/module/az.websites/new-azappserviceplan?view=azps-2.3.2 https://docs.microsoft.com/en-us/powershell/module/az.websites/new-azwebapp?view=azps-2.3.2 https://docs.microsoft.com/en-us/powershell/module/az.websites/new-azwebappslot?view=azps-2.3.2