Courseiva
← Back to Microsoft Azure Developer Associate AZ-204 questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise Microsoft Azure Developer Associate AZ-204 practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
AZ-204
exam code
Microsoft
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related AZ-204 topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1mediummultiple choice
Full question →

Refer to the exhibit. You have an Azure Policy definition as shown. Your team creates a storage account with network rules set to 'Deny' by default, and then adds an IP rule to allow traffic from a specific IP range. What compliance state will this storage account be reported as?

Exhibit

{
  "type": "Microsoft.Authorization/policyDefinitions",
  "properties": {
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Storage/storageAccounts"
          },
          {
            "field": "Microsoft.Storage/storageAccounts/networkAcls.defaultAction",
            "equals": "Allow"
          }
        ]
      },
      "then": {
        "effect": "Audit"
      }
    }
  }
}
Question 2hardmultiple choice
Full question →

Refer to the exhibit. You run the Azure CLI command to list blobs in a container that are larger than 1 MB. The command returns no results even though you know there are blobs larger than 1 MB. What is the most likely cause?

Network Topology
account-name mystorageaccountcontainer-name mycontainerquery "[?properties.contentLength > `1000000`].{name:nameoutput tableRefer to the exhibit.
Question 3hardmultiple choice
Full question →

Refer to the exhibit. You run the above Azure CLI command to upload a blob to Azure Blob Storage. The command fails with the error 'This request is not authorized to perform this operation.' You have verified that the storage account name and container name are correct, and the file exists. What should you do to resolve the error?

Exhibit

Refer to the exhibit.

az storage blob upload \
  --account-name mystorageaccount \
  --container-name mycontainer \
  --name myblob \
  --file /path/to/file \
  --auth-mode key
Question 4hardmultiple choice
Full question →

You are creating an Azure Container Instance using the Azure CLI command shown in the exhibit. The container needs to connect to a SQL database. After running the command, you notice that the DB_PASSWORD environment variable is visible in the container's logs. What is the most likely reason?

Network Topology
az container createresource-group myRGname mycontainerimage myimage:latestcpu 1memory 1.5ports 80environment-variables DB_HOST=mydb.database.windows.net DB_NAME=mydbsecure-environment-variables DB_PASSWORD=supersecretRefer to the exhibit.
Question 5mediummultiple choice
Full question →

Refer to the exhibit. You have an HTTP-triggered Azure Function that writes the request body to a blob in the 'samples-workitems' container. The function runs successfully but does not create a blob. What is the most likely cause?

Exhibit

public static async Task<IActionResult> Run(
    [HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req,
    [Blob("samples-workitems/{rand-guid}", FileAccess.Write)] Stream blobStream,
    ILogger log)
{
    string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
    byte[] bytes = Encoding.UTF8.GetBytes(requestBody);
    await blobStream.WriteAsync(bytes, 0, bytes.Length);
    return new OkResult();
}
Question 6hardmultiple choice
Full question →

Refer to the exhibit. You deploy the ARM template to create an Azure Key Vault. After deployment, you attempt to add an access policy to grant a user 'Get' secret permissions using the Azure portal, but the option is grayed out. What is the most likely reason?

Exhibit

{
  "type": "Microsoft.KeyVault/vaults",
  "apiVersion": "2022-07-01",
  "name": "myKeyVault",
  "location": "[resourceGroup().location]",
  "properties": {
    "sku": {
      "family": "A",
      "name": "standard"
    },
    "tenantId": "[subscription().tenantId]",
    "accessPolicies": [],
    "enabledForDeployment": false,
    "enabledForDiskEncryption": false,
    "enabledForTemplateDeployment": false,
    "enableSoftDelete": true,
    "softDeleteRetentionInDays": 90,
    "enableRbacAuthorization": true
  }
}
Question 7easymultiple choice
Full question →

Refer to the exhibit. A developer is creating an Azure Data Factory pipeline to copy data from Azure Blob Storage to Azure SQL Database. The pipeline fails with a timeout error when copying large files. Which action should the developer take to resolve the issue?

Exhibit

Refer to the exhibit.

```json
{
  "type": "Microsoft.DataFactory/factories/pipelines",
  "properties": {
    "activities": [
      {
        "name": "CopyData",
        "type": "Copy",
        "inputs": [
          {
            "referenceName": "BlobInput",
            "type": "DatasetReference"
          }
        ],
        "outputs": [
          {
            "referenceName": "SqlOutput",
            "type": "DatasetReference"
          }
        ],
        "typeProperties": {
          "source": {
            "type": "BlobSource"
          },
          "sink": {
            "type": "SqlSink"
          }
        }
      }
    ]
  }
}
```
Question 8hardmultiple choice
Full question →

Refer to the exhibit. You are deploying an ARM template that assigns the 'Storage Blob Data Contributor' role to the managed identity of an App Service named 'myapp' at the storage account 'mystorageacct' scope. The deployment fails with an error that 'principalId' is null. What is the most likely cause?

Exhibit

Refer to the exhibit.

{
    "type": "Microsoft.Authorization/roleAssignments",
    "apiVersion": "2022-04-01",
    "name": "[guid(resourceGroup().id, 'Storage Blob Data Contributor')]",
    "properties": {
        "roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
        "principalId": "[reference(resourceId('Microsoft.Web/sites', 'myapp'), '2022-03-01', 'Full').identity.principalId]",
        "scope": "[resourceId('Microsoft.Storage/storageAccounts', 'mystorageacct')]"
    }
}
Question 9easymultiple choice
Full question →

You are reviewing an ARM template snippet for an Azure App Service. The exhibit shows the site configuration. You need to ensure that the app supports WebSocket connections for a real-time feature. Which setting must be added?

Exhibit

Refer to the exhibit.

{
  "type": "Microsoft.Web/sites",
  "apiVersion": "2023-01-01",
  "name": "[parameters('webAppName')]",
  "kind": "app",
  "properties": {
    "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
    "siteConfig": {
      "alwaysOn": true,
      "http20Enabled": true,
      "minTlsVersion": "1.2",
      "ftpsState": "FtpsOnly"
    }
  }
}
Question 10easymultiple choice
Full question →

Refer to the exhibit. You created a custom RBAC role definition. A user assigned this role at the subscription scope. What can the user do?

Exhibit

{
  "type": "Microsoft.Authorization/roleDefinitions",
  "properties": {
    "roleName": "Custom SQL DB Reader",
    "description": "Read-only access to Azure SQL Database",
    "permissions": [
      {
        "actions": [
          "Microsoft.Sql/servers/databases/read"
        ],
        "notActions": []
      }
    ],
    "assignableScopes": [
      "/subscriptions/12345678-1234-1234-1234-123456789abc"
    ]
  }
}
Question 11mediummultiple choice
Full question →

Refer to the exhibit. You run this KQL query in Azure Monitor Logs. What does the timechart display?

Exhibit

requests
| where timestamp > ago(1h)
| summarize count() by bin(timestamp, 5m), resultCode
| render timechart
Question 12mediummultiple choice
Full question →

Refer to the exhibit. You run the Get-AzStorageAccount cmdlet and see the output above. You need to enable the hierarchical namespace feature for this storage account. What should you do first?

Exhibit

Name                    : stg1
ResourceGroupName       : rg1
Location                : eastus
SkuName                 : Standard_GRS
Kind                    : StorageV2
AccessTier              : Cool
Encryption              : {"services":{"blob":{"enabled":true,"lastEnabledTime":"2025-01-01T00:00:00Z"},"file":{"enabled":true,"lastEnabledTime":"2025-01-01T00:00:00Z"}},"keySource":"Microsoft.Storage"}
Question 13hardmultiple choice
Full question →

Refer to the exhibit. You have an Azure Storage account with a blob container named container1. The container's public access level is set to Blob (anonymous read access for blobs only). You attempt to assign the custom role defined in the JSON using Azure PowerShell. The role assignment fails. What is the most likely reason?

Exhibit

{
  "version": "2019-04-01",
  "statement": [
    {
      "effect": "Allow",
      "principal": {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      },
      "action": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/read"
      ],
      "resource": "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/stg1/blobServices/default/containers/container1",
      "condition": {
        "StringEquals": {
          "Microsoft.Storage/blob/publicAccess": "none"
        }
      }
    }
  ]
}
Question 14mediummultiple choice
Full question →

You deploy the ARM template shown in the exhibit. After deployment, you need to change the replication to geo-redundant storage (GRS) with read access (RA-GRS). What should you do?

Exhibit

Refer to the exhibit. The following is a snippet of an Azure Resource Manager (ARM) template for a storage account:

{
  "type": "Microsoft.Storage/storageAccounts",
  "apiVersion": "2023-01-01",
  "name": "[parameters('storageAccountName')]",
  "location": "[resourceGroup().location]",
  "sku": {
    "name": "Standard_GRS"
  },
  "kind": "StorageV2",
  "properties": {
    "accessTier": "Hot",
    "supportsHttpsTrafficOnly": true
  }
}
Question 15mediummultiple choice
Full question →

Refer to the exhibit. You are reviewing an Azure Policy definition. When applied to a subscription, what is the effect of this policy?

Exhibit

{
  "properties": {
    "mode": "Indexed",
    "parameters": {
      "allowedLocations": {
        "type": "array",
        "defaultValue": [
          "eastus",
          "westus"
        ]
      }
    },
    "policyRule": {
      "if": {
        "not": {
          "field": "location",
          "in": "[parameters('allowedLocations')]"
        }
      },
      "then": {
        "effect": "deny"
      }
    }
  }
}

These AZ-204 practice questions are part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style AZ-204 questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.