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 API in Azure API Management using an ARM template. The API is configured to use OAuth 2.0 authentication. The deployment fails with a validation error. What is the most likely cause?

Exhibit

{
  "resources": [
    {
      "type": "Microsoft.ApiManagement/service/apis",
      "apiVersion": "2022-08-01",
      "name": "[concat(parameters('apimServiceName'), '/myapi')]",
      "properties": {
        "displayName": "My API",
        "path": "myapi",
        "protocols": ["https"],
        "serviceUrl": "https://mybackend.azurewebsites.net",
        "authenticationSettings": {
          "oAuth2": {
            "authorizationServerId": "auth-server-1",
            "scope": "read write"
          }
        }
      },
      "dependsOn": [
        "[resourceId('Microsoft.ApiManagement/service/authorizationServers', parameters('apimServiceName'), 'auth-server-1')]"
      ]
    }
  ]
}
Question 9easymultiple choice
Full question →

Refer to the exhibit. You are analyzing the Azure Blob Storage service properties configured for a storage account. A web application hosted at https://www.contoso.com attempts to make a PUT request to a blob. The request fails with a CORS error. What is the most likely cause?

Exhibit

{
  "version": "2019-04-01",
  "properties": {
    "cors": {
      "corsRules": [
        {
          "allowedOrigins": ["https://www.contoso.com"],
          "allowedMethods": ["GET", "PUT"],
          "allowedHeaders": ["*"],
          "exposedHeaders": ["x-ms-request-id"],
          "maxAgeInSeconds": 3600
        }
      ]
    },
    "deleteRetentionPolicy": {
      "enabled": true,
      "days": 7
    }
  }
}
Question 10hardmultiple choice
Full question →

Refer to the exhibit. The exhibit shows an Azure Event Grid subscription configuration. You notice that the webhook endpoint is not receiving events when a .png file is uploaded to the 'images' container. What is the most likely reason?

Exhibit

{
  "properties": {
    "enabled": true,
    "events": [
      "Microsoft.Storage.BlobCreated",
      "Microsoft.Storage.BlobDeleted"
    ],
    "destination": {
      "endpointType": "WebHook",
      "properties": {
        "endpointUrl": "https://myapp.azurewebsites.net/api/events"
      }
    },
    "filter": {
      "subjectBeginsWith": "/blobServices/default/containers/images/",
      "subjectEndsWith": ".jpg"
    }
  }
}
Question 11hardmultiple 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 12easymultiple 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 13easymultiple 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 14mediummultiple 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 15mediummultiple 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"}

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.