Courseiva
Develop Azure compute solutionshardMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

Exhibit

Refer to the exhibit.

```json
{
  "name": "myApp",
  "type": "Microsoft.Web/sites",
  "apiVersion": "2022-09-01",
  "location": "westus",
  "properties": {
    "serverFarmId": "/subscriptions/{sub-id}/resourceGroups/myRG/providers/Microsoft.Web/serverfarms/myPlan",
    "siteConfig": {
      "appSettings": [
        {
          "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
          "value": "1234-5678"
        }
      ]
    },
    "identity": {
      "type": "SystemAssigned"
    }
  },
  "dependsOn": [
    "[resourceId('Microsoft.OperationalInsights/workspaces', 'myWorkspace')]"
  ]
}
```

You deploy the above ARM template resource. After deployment, the web app cannot connect to Application Insights. The Application Insights resource exists in the same region. What is the most likely cause?

⚠ Common exam trap

A common mix-up: candidates assume the instrumentation key is still the primary connection method, but Microsoft deprecated it in favor of the connection string, which is required for newer SDK versions and regional routing.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The app setting 'APPINSIGHTS_INSTRUMENTATIONKEY' is deprecated; you should use 'APPLICATIONINSIGHTS_CONNECTION_STRING' instead.

The ARM template likely sets the 'APPINSIGHTS_INSTRUMENTATIONKEY' app setting, which is deprecated. Application Insights now requires the 'APPLICATIONINSIGHTS_CONNECTION_STRING' app setting for authentication and telemetry ingestion, as the instrumentation key alone is no longer sufficient for newer SDK versions and regional endpoints.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The dependsOn is incorrect; it should reference the Application Insights resource ID.

    Why it's wrong here

    The `dependsOn` property in an ARM template is used to establish deployment order, ensuring that a referenced resource is fully deployed before the dependent resource. While `dependsOn` should indeed reference the Application Insights resource (typically by its full resource ID or name with `resourceId()` function) to guarantee its existence, the core problem addressed by the question is not the dependency itself, but the deprecated application setting being configured.

  • The app setting 'APPINSIGHTS_INSTRUMENTATIONKEY' is deprecated; you should use 'APPLICATIONINSIGHTS_CONNECTION_STRING' instead.

    Why this is correct

    The `APPINSIGHTS_INSTRUMENTATIONKEY` application setting is indeed deprecated for Azure Application Insights integration in modern Azure App Services and functions. The current and recommended practice is to utilize the `APPLICATIONINSIGHTS_CONNECTION_STRING` setting instead. This connection string provides enhanced security, supports sovereign clouds, and enables custom endpoint configurations, offering a more robust and flexible way to send telemetry data.

  • The web app needs a user-assigned managed identity to access Application Insights.

    Why it's wrong here

    A user-assigned managed identity is not a prerequisite for an Azure Web App to send telemetry to Application Insights. Managed identities are primarily used for securely authenticating the web app to other Azure services, such as Azure Key Vault or Azure SQL Database, without managing credentials. Telemetry ingestion into Application Insights relies on the provided instrumentation key or, more commonly now, the connection string, which acts as an identifier for the target Application Insights resource.

  • The instrumentation key must be set under a different name, like 'APPINSIGHTS_KEY'.

    Why it's wrong here

    Renaming the instrumentation key to `APPINSIGHTS_KEY` would not resolve the underlying issue, as this is not a recognized or supported application setting for Application Insights telemetry collection. The correct and current standard for configuring Application Insights integration in Azure App Services is to use the `APPLICATIONINSIGHTS_CONNECTION_STRING` setting. Any other custom key name would prevent the automatic telemetry collection from functioning correctly.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.