AZ-104 Question 115
Single answerYou have a Bicep file that deploys a storage account. Part of the file is shown below:
param storageSKU string = 'Standard_LRS'
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' = { name: 'mydemo${uniqueString(resourceGroup().id)}' location: resourceGroup().location sku: { name: storageSKU } kind: 'StorageV2' }
Which statement best describes what will happen when this Bicep file is deployed?
- A
The storage account is created with the default SKU if no other SKU parameter is provided at deployment.
- B
The deployment will fail because uniqueString is not a valid function in Bicep.
- C
The storage account name is guaranteed to be unique for all subscriptions due to the uniqueString function.
- D
The deployment fails because 'StorageV2' is not a valid kind for a storage account resource.
Show answer and explanation
Correct answer: A
Explanation
By examining the provided Bicep snippet, you can see that the 'storageSKU' parameter has a default value of 'Standard_LRS'. Additionally, 'StorageV2' is a valid kind, and the uniqueString function is valid in Bicep but does not guarantee a globally unique name across every Azure subscription. Therefore, option 1 correctly describes the behavior of the resource deployment.
- A. Correct.
This is correct. The parameter 'storageSKU' defaults to 'Standard_LRS', and the storage account is created using that SKU unless a different SKU is passed at deployment.
- B. Incorrect.
This is incorrect. The uniqueString function is valid in Bicep and is commonly used for creating unique names.
- C. Incorrect.
This is partially incorrect. While uniqueString helps to ensure uniqueness within a resource group scope, it does not guarantee that the name is globally unique across all Azure subscriptions.
- D. Incorrect.
This is incorrect. 'StorageV2' is a valid kind value for a storage account in Azure.