Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Deploy infrastructure using Bicep templates and Azure CLI

A worked example

Complete the statement

You run azd up from the root of a GenAIOps repository and choose the Sweden Central location. The deployment fails because the default model deployment defined by the template is not available in that region. A company policy requires all resources for this project to stay in Sweden Central.

How should you complete the deployment and still meet the policy?

Change in , and then run .

  • Blank 1: the model in the aiProjectDeploymentsJson block (correct answer)

    The failure comes from the default model, so you must replace it in the aiProjectDeploymentsJson block with a model that is available in the region. Changing the Azure location breaks the Sweden Central policy. The environment name is only used to name resources, so changing it does not fix model availability.

  • Blank 2: infra/main.bicep (correct answer)

    The aiProjectDeploymentsJson block is in infra/main.bicep, which is among the Bicep files that azd up deploys. azure.yaml is the project configuration file, not the model deployment definition. .env is created from azd env get-values after provisioning and is read by your code, so editing it does not change what is deployed.

  • Blank 3: azd up (correct answer)

    You must rerun azd up so the corrected Bicep templates are deployed. azd env get-values > .env only writes environment values to a file. azd init sets up a project from a template and does not deploy the change.

Why

The template's default model is not offered in the chosen region, and the policy rules out moving to another region. The fix is to set a compatible model in the aiProjectDeploymentsJson block of infra/main.bicep. You then rerun azd up so the Bicep templates are deployed again with the new model.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free