Courseiva

Fixing a Deployment Failure Caused by a Runtime Stack Mismatch

Exhibit

Refer to the exhibit.
```powershell
# Output from Azure CLI
{
  "id": "/subscriptions/.../resourceGroups/rg-prod/providers/Microsoft.Web/sites/app-prod",
  "kind": "app,linux",
  "siteConfig": {
    "linuxFxVersion": "DOTNETCORE|6.0",
    "appSettings": [
      {
        "name": "ASPNETCORE_ENVIRONMENT",
        "value": "Production"
      }
    ]
  }
}
```

Refer to the exhibit. An Azure CLI command outputs the configuration of an Azure Web App. Your pipeline deploys to this Web App using the 'AzureWebApp@1' task. The deployment fails with an error indicating that the runtime stack is not supported. What is the most likely cause?

Quick Answer

A 'runtime stack is not supported' failure on an AzureWebApp@1 deployment means the Web App's configured stack — DOTNETCORE|6.0 in this case — doesn't match what the deployed application actually targets. The task deploys according to the Web App's own stack setting, so if the app was built for a different runtime version, the mismatch causes the deployment to fail outright.

⚠ Common exam trap

A common mix-up: candidates confuse runtime stack errors with environment variable misconfigurations (like ASPNETCORE_ENVIRONMENT) or OS-level issues, but the error message directly points to a mismatch between the Web App's configured stack and the deployed application's framework.

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 runtime stack (DOTNETCORE|6.0) is not compatible with the deployed application.

The error 'runtime stack is not supported' indicates that the Azure Web App's configured runtime stack (DOTNETCORE|6.0) does not match the application being deployed. The AzureWebApp@1 task uses the Web App's stack setting to determine how to deploy and run the code; if the deployed app requires a different runtime (e.g., .NET 8.0 or a non-.NET framework), the deployment fails. Option C correctly identifies this mismatch as the root cause.

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 Web App is not a Linux app.

    Why it's wrong here

    The AzureWebApp@1 task supports both Windows and Linux App Service plans, so the host OS alone does not trigger an unsupported runtime stack error. It is tempting because Linux apps use different runtime identifiers, but the failure stems from the configured stack value, not the operating system.

  • ✗

    The ASPNETCORE_ENVIRONMENT setting is incorrect.

    Why it's wrong here

    ASPNETCORE_ENVIRONMENT is an application setting read at runtime by the app's configuration builder; it does not declare the platform runtime stack to App Service. It is tempting because misconfigured environment names cause startup failures, but those manifest as application errors, not deployment-time stack validation.

  • ✓

    The runtime stack (DOTNETCORE|6.0) is not compatible with the deployed application.

    Why this is correct

    The AzureWebApp@1 task deploys the built artefact to the Web App's configured runtime; if the app's stack is DOTNETCORE|6.0 but the artefact targets an incompatible framework, the task rejects it. The mismatch between configured stack and application is the cause.

  • ✗

    The resource group name is incorrect.

    Why it's wrong here

    An incorrect resource group name causes a resource-not-found or authorisation failure during deployment, not a runtime stack validation message. It is tempting because resource group mistakes are a common pipeline fault, but the task resolves the Web App successfully before inspecting its configured stack.

About these practice questions

This AZ-400 question is part of Courseiva's 696-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO tasks can be used to deploy an Azure Web App using YAML pipelines in Azure DevOps?

medium
  • ✓ A.AzureWebApp
  • B.CopyFilesOverSSH
  • ✓ C.AzureRmWebAppDeployment
  • D.AzureFunctionApp
  • E.AzureVMAppDeployment

Why A: The AzureWebApp task is correct because it is the dedicated Azure DevOps YAML pipeline task for deploying code to an Azure Web App (App Service). It supports deployment methods like Web Deploy (msdeploy), Kudu REST API, and ZIP deploy, making it the standard choice for web app deployments.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-400 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-400 exam.