exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 9 question 23 discussion

Actual exam question from Microsoft's AZ-400
Question #: 23
Topic #: 9
[All AZ-400 Questions]

HOTSPOT
-

You have a management group that contains four Azure subscriptions. Each subscription contains four resource groups.

You develop a new web app named App1.

You plan to deploy an instance of App1 to each resource group.

You need to create a Bicep template that will be used to deploy App1. The solution must meet the following requirements:

• The name of each App1 instance must be consistent for each subscription and resource group.
• The name of each App Service plan used to host App1 must be consistent.

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

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Skankhunt
10 months ago
What a stupid question.. I guess they want to test your knowledge on the fact that one App Service Plan can have multiple Apps associated with it. Although I can't entirely agree with this in real-life environments, the given answer is correct.
upvoted 2 times
OlehT
9 months, 3 weeks ago
I think they want to test Biceps knowledge. Also, I think we want to have App Services and Plan in the same RG.
upvoted 1 times
...
...
husam421
10 months, 2 weeks ago
param location string = resourceGroup().location param environmentName string param appServiceAppName string = 'app-contoso-${environmentName}-${uniqueString(resourceGroup().id)}' param appServicePlanName string = 'plan-contoso-${environmentName}-${uniqueString(resourceGroup().id)}' resource appServiceApp 'Microsoft.Web/sites@2022-09-01' = { name: appServiceAppName // ... } resource appServicePlan 'Microsoft.Web/serverfarms@2022-09-01' = { name: appServicePlanName // ... }
upvoted 4 times
...
arr73
12 months ago
Answer should be "resourceGroup().id" in both slots. Reason: App name should be unique. The only valid option for this is "resourceGroup().id". And plan name should use the same string to be consistent. The link below is a reference for this solution in MS Documentation: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/patterns-name-generation#example-1-organizational-naming-convention
upvoted 4 times
...
FeriAZ
1 year, 2 months ago
By using (resourceGroupName), the parameter values for planname and appname will be populated with the actual name of the resource group where the deployment is taking place. param location string = resourceGroup().location param planname string = toLower('AppServicePlan-${uniqueString((resourceGroupName))}') param appname string = toLower('app-${uniqueString((resourceGroupName))}') resource webappplan 'Microsoft.Web/serverfarms@2022-09-01' = { name: planname location: location sku: { name: 'B1' tier: 'Basic' } }
upvoted 2 times
...
Nian
1 year, 2 months ago
'Consistent' is unclear - I guess they are asking for scope of uniqueness. Hence provided answer should be correct. planname -> subscription-id (same plan can hold apps from different res-groups) appname -> resourcegrp-id
upvoted 4 times
60ties
10 months, 1 week ago
U're right that 'Consistent' is unclear.
upvoted 1 times
...
chloaus
1 year ago
Provided answers are correct, https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/patterns-name-generation
upvoted 1 times
...
...
6c01613
1 year, 3 months ago
I would select deployment name for app service and rg id for app instance. But to me this request of bring consistent is not clear. https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/patterns-name-generation Resources checked: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-string#uniquestring
upvoted 2 times
...
djhyfdgjk
1 year, 3 months ago
Provided answers are wrong. Resource group id is a long string with slashes. It would be terrible idea to try to include it in the resource name. Same goes for Subscription id. What is the advantage of including thid long GUID into resource name ?? I would go with resource group name for both questions.
upvoted 2 times
6c01613
1 year, 3 months ago
UniqueString: The returned value is 13 characters long. https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-string#uniquestring
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...