Exam Question Flashcards
Question #27
You are preparing to deploy a website to an Azure Web App from a GitHub repository. The website includes static content generated by a script.
You plan to use the Azure Web App continuous deployment feature.
You need to run the static generation script before the website starts serving traffic.
What are two possible ways to achieve this goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
A. Add the path to the static content generation tool to WEBSITE_RUN_FROM_PACKAGE setting in the host.json file.
B. Add a PreBuild target in the websites csproj project file that runs the static content generation script.
C. Create a file named run.cmd in the folder /run that calls a script which generates the static content and deploys the website.
D. Create a file named .deployment in the root of the repository that calls a script which generates the static content and deploys the website.
Correct Answer: AD
A: In Azure, you can run your functions directly from a deployment package file in your function app. The other option is to deploy your files in
the
\wwwroot directory of your function app (see A above).
To enable your function app to run from a package, you just add a setting to your function app settings.
Note: The host.json metadata file contains global configuration options that affect all functions for a function app.
D: To customize your deployment, include a .deployment file in the repository root.
You just need to add a file to the root of your repository with the name .deployment and the content:
You are developing an application to use Azure Blob storage. You have configured Azure Blob storage to include change feeds.
A copy of your storage account must be created in another region. Data must be copied from the current storage account to the new storage
account directly between the storage servers.
You need to create a copy of the storage account in another region and copy the data.
In which order should you perform the actions? To answer, move all actions from the list of actions to the answer area and arrange them in the
- Use AzCopy to copy the data to the new storage account
- Export a Resource Manager Template
- Modify the template by changing the storage account name and region
- Create a new Template deployment
- Deploy the template to create a new storage account in the target region
- Create a new Template deployment
- Export a Resource Manager Template
- Modify the template by changing the storage account name and region
- Deploy the template to create a new storage account in the target region
- Use AzCopy to copy the data to the new storage account
You are preparing to deploy an Azure virtual machine (VM)-based application.
The VMS that run the application have the following requirements:
When a VM is provisioned the firewall must be automatically configured before it can access Azure resources.
Supporting services must be installed by using an Azure PowerShell script that is stored in Azure Storage.
You need to ensure that the requirements are met.
Which features should you use? To answer, drag the appropriate features to the correct requirements. Each feature may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
choice here:
Features
Serial console
Custom Script Extension
Run Command
Hybrid Runbook Worker
Requirement
Firewall configuration - {Answer here}
Supporting serivces script - {Answer here}
Firewall configuration -> Run Command
Supporting serivces script -> Hybrid Runbook Worker
A company is developing a Node.js web app. The web app code is hosted in a GitHub repository located at
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.
$gltrepo=”https://github.convTailSpinToys,’webapp”
$webappnarne=TailSpinToysWeb”
{dropdown}-Name myResourceGroup -Location $location
New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup
{dropdown}-Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Standard
New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup
{dropdown}-Name $webappname -Location $location -AppServicePlan $webappname -ResourceGroupName myResourceGroup
New-AzWebAppSlot
New-AzWebApp
New-AzAppService
New-AzResourceGroup
{dropdown}Name $webappname -ResourceGroupName myResourceGroup -Slot review
New-AzWebAppSlot
New-AzWebApp
New-AzAppServicePlan
New-AzResourceGroup
$ProperiesObject = “$gitrepo”;branch = “master”;}
Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName myResourceGroup -ResourceType
Microsoft. Web/sites/slots/sourcecontrols -ResourceName $webappname/revtew/web -ApiVersion 2015-08-01 -Force
Switch-AzWebAppSlot -Name $webappname -ResourceGroupName myResourceGroup
-SourceSlotNarne review -DestinationSlotName production
{dropdown}-Name myResourceGroup -Location $location
New-AzResourceGroup
{dropdown}-Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Standard
New-AzAppServicePlan
{dropdown}-Name $webappname -Location $location -AppServicePlan $webappname -ResourceGroupName myResourceGroup
New-AzWebApp
{dropdown}Name $webappname -ResourceGroupName myResourceGroup -Slot review
New-AzWebAppSlot
You are developing an application that needs access to an Azure virtual machine (VM).
The access lifecycle for the application must be associated with the VM service instance.
You need to enable managed identity for the VM.
How should you complete the PowerShell segment? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
Answer Area
$vm = Get-AzVM -ResourceGroupName “ContosoRG” -Name “ContosoVM”
Update-AzVM -ResourceGroupName “ContosoRG” -VM $vm {dropdown1} {dropdown2}
dropdown1
-Assignldentity:
IdentityType :
dropdown2
$SystemAssigned
$UserAssigned
Correct Answer:
Box 1: -IdentityType -
Enable system-assigned managed identity on an existing Azure VM:
To enable a system-assigned managed identity, use the -IdentityType switch on the Update-AzVM cmdlet (see below).
Box 2: $SystemAssigned -
$vm = Get-AzVM -ResourceGroupName myResourceGroup -Name myVM
Update-AzVM -ResourceGroupName myResourceGroup -VM Svm -IdentityType SystemAssigned
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/qs-configure-powershell-windows-vm
You develop a software as a service (SaaS) offering to manage photographs. Users upload photos to a web service which then stores the photos
in Azure
Storage Blob storage. The storage account type is General-purpose V2.
When photos are uploaded, they must be processed to produce and save a mobile-friendly version of the image. The process to produce a mobile-
friendly version of the image must start in less than one minute.
You need to design the process that starts the photo processing.
Solution: Create an Azure Function app that uses the Consumption hosting model and that is triggered from the blob upload.
Does the solution meet the goal?
A. Yes
B. No
Correct Answer: A
Yes, the solution meets the goal. Creating an Azure Function app that uses the Consumption hosting model and is triggered by the blob upload is an effective way to start the photo processing quickly. Azure Functions can respond to events in near real-time, ensuring that the process to produce a mobile-friendly version of the image starts within the required timeframe1.
Upload and analyze a file with Azure Functions and Blob Storage
https://learn.microsoft.com/en-us/azure/storage/blobs/blob-upload-function-trigger
In this tutorial, you’ll learn how to upload an image to Azure Blob Storage and process it using Azure Functions and Computer Vision. You’ll also learn how to implement Azure Function triggers and bindings as part of this process.
You develop and deploy an Azure App Service API app to a Windows-hosted deployment slot named Development. You create additional
deployment slots named Testing and Production. You enable auto swap on the Production deployment slot.
You need to ensure that scripts run and resources are available before a swap operation occurs.
Solution: Update the app with a method named statuscgheck to run the scripts. Update the app settings for the app. Set the
WEBSITE_SWAP_WARMUP_PING_PATH and WEB_SWAP_WARMUP_PING_STATUS with a path to the new method and appropriate response
codes.
Does the solution meet the goal?
A. No
B. Yes
Correct Answer: B
Yes, the solution meets the goal. By updating the app with a method named statuscheck to run the scripts and configuring the app settings with WEBSITE_SWAP_WARMUP_PING_PATH and WEB_SWAP_WARMUP_PING_STATUS, you ensure that the necessary scripts run and resources are available before a swap operation occurs. This setup leverages Azure’s built-in health check feature to validate the app’s readiness before completing the swap1.
You create the following PowerSheII script:
$source New-AzSchedu1edQueryRu1eSource -Query ‘Heartbeat I where TimeGenerated > ago(lh)’ -DataSourceId “contoso”
$schedule New-AzSchedu1edQueryRu1eSchedu1e -FrequencyInMinutes 60 -TimeWindowInMinutes 60
$triggerCondition - New-AzSchedu1edQueryRuleTriggerCondition -ThresholdOperator “LessThan” -Threshold 5
$aznsActionGroup * New-AzScheduledQueryRuleAznsActionGroup -ActionGroup “contoso” -EmailSubject “Custom email subject”
-CustomWebhookPay10ad “{ * “alert’”: * “#alertrulename’”,
$a1ertingAction New-AzSchedu1edQueryRu1eA1ertingAction -AznsAction
$aznsActionGroup -Severity “3” -Trigger $triggerCondition
New-AzSchedu1edQueryRu1e -ResourceGroupName “contoso” -Location “eastus” -Action $alertingAction -Enabled $true
-Description “Alert description” -Schedule $schedule -Source $source -Name “Alert Name”
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
Answer Area
A log alert is created that sends an email when the CPU
percentage is above 60 percent for five minutes.
A. No
B. Yes
A log alert is created that sends an email when the number of
virtual machine heartbeats in the past hour is less than five.
A. No
B. Yes
The log alert is scheduled to run every two hours.
A. No
B. Yes
Box 1: No
The AzScheduledQueryRuleSource is Heartbeat, not CPU.
Box 2: Yes -
The AzScheduledQueryRuleSource is Heartbeat!
Note: New-AzScheduledQueryRuleTriggerCondition creates an object of type Trigger Condition. This object is to be passed to the command that creates Alerting Action object.
Box 3: No -
The schedule is 60 minutes, not two hours.
-FrequencyInMinutes: The alert frequency.
-TimeWindowlnMinutes: The alert time window
The New-AzAscheduIedQueryRuIeScheduIe command creates an object of type Schedule. This object is to be passed to the command that
creates Log Alert
Rule.
You are developing an Azure Function app.
The app must meet the following requirements:
Enable developers to write the functions by using the Rust language.
Declaratively connect to an Azure Blob Storage account.
You need to implement the app.
Which Azure Function app features should you use? To answer, drag the appropriate features to the correct requirements. Each feature may be
used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Enable developers to write the functions by using the Rust language. Which feature should I use? {Box 1)
And
Declaratively connect to an Azure Blob Storage Trigger account. Which feature should I use? {Box 2}
Choose :
Custom handler
Extension bundle
Trigger
Runtime
Policy
Hosting plan
Box 1: Custom handler
Custom handlers can be used to create functions in any language or runtime by running an HTTP server process, for example Go or Rust.
Box 2: Trigger -
Functions are invoked by a trigger and can have exactly one. In addition to invoking the function, certain triggers also serve as bindings. You
may also define multiple bindings in addition to the trigger. Bindings provide a declarative way to connect data to your code.
Reference:
https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-other https://docs.microsoft.com/en-us/dotnet/architecture/serverless/azure-functions
Correct Answer:
Enable developers to write the functions by using Custom handler
the Rust language. {pick one from choose}
Declaratively connect to an Azure Blob Storage Trigger
account. {pick one from choose}
You are developing an ASP.NET Core web application. You plan to deploy the application to Azure Web App for Containers.
The application needs to store runtime diagnostic data that must be persisted across application restarts. You have the following code:
public void SaveDiagData (string data)
var path = Environment. GetEnvironmentVaziabIe (“DIAGDÄTA”) ;
File . WriteAIIText (Path. Combine (path, “data”) , data) ;
You need to configure the application settings so that diagnostic data is stored as required.
How should you configure the web app’s settings? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
App setting: Value:
{dropdown 1} true
DIAGDATA {dropdown 2}
dropdown 1:
LOCALAPPDATA
WEBSITE_LOCALCACHE_ENABLED
DOTNET_HOSTlNG_OPTIMIZATION_CACHE
WEBSITES_ENABLE_APP_SERVICE_STORAGE
dropdown 2:
/home
/local
D:\home
D:\local
App setting: Value:
WEBSITES_ENABLE_APP_SERVICE_STORAGE true
DIAGDATA /home
Correct Answer:
Box 1:
If WEBSITES_ENABLE_APP_SERVICE_STORAGE setting is unspecified or set to true, the /home/ directory will be shared across scale instances,
and files written will persist across restarts
Box 2: /home -
Reference:
https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-faq
You have two Hyper-V hosts named Hostl and Host2_ Hostl has an Azure virtual machine named VMI that was deployed by using a custom
Azure Resource
Manager template.
You need to move ‘VMI to Host2.
What should you do?
A. From the Update management blade, click Enable.
B. From the Overview blade, move VMI to a different subscription.
C. From the Redeploy blade, click Redeploy.
D. From the Profile blade, modify the usage location.
Correct Answer: C
When you redeploy a VM, it moves the VM to a new node within the Azure infrastructure and then powers it back on, retaining all your
configuration options and associated resources.
Reference:
Community vote distribution
You have downloaded an Azure Resource Manager template to deploy numerous virtual machines. The template is based on a current virtual
machine, but must be adapted to reference an administrative password.
You need to make sure that the password is not stored in plain text.
You are preparing to create the necessary components to achieve your goal.
Which Of the following should you create to achieve your goal? Answer by dragging the correct option from the list to the answer area.
Select and Place:
Options
An Azure Key Vault
An Azure Storage account
Azure Active Directory (AD)
Identity Protection
An access policy
An Azure policy
A backup policy
Answer
An Azure Key Vault
An access policy
Your company has an Azure Kubernetes Service (AKS) cluster that you manage from an Azure AD-joined device. The cluster is located in a
resource group.
Developers have created an application named MyApp. MyApp was packaged into a container image.
You need to deploy the YAML manifest file for the application.
Solution: You install the Azure CLI on the device and run the kubectl apply ‘“f myapp.yaml command.
Does this meet the goal?
A. yes
B. No
Correct Answer: A
kubectl apply -f myapp.yaml applies a configuration change to a resource from a file or stdin.
Reference:
https://kubernetes.io/docs/reference/kubectl/overview/
https//docs.microsoft.com/en-us/cli/azure/aks
Community vote distribution
Your company has a web app named WebApp1.
You use the WebJobs SDK to design a triggered App Service background task that automatically invokes a function in the code every time new
data is received in a queue.
You are preparing to configure the service processes a queue data item.
Which of the following is the service you should use?
A. Logic Apps
B. WebJobs
C. Flow
D. Functions
Correct Answer: B
Your company has an Azure Kubernetes Service (AKS) cluster that you manage from an Azure AD-joined device. The cluster is located in a
resource group.
Developers have created an application named MyApp. MyApp was packaged into a container image.
You need to deploy the YAML manifest file for the application.
Solution: You install the docker client on the device and run the docker run -it microsoft/azure-cli:0.10.17 command.
Does this meet the goal?
A. yes
B. No
Correct Answer: B