Courseiva
Develop Azure compute solutionsmediumMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

Exhibit

Refer to the exhibit.

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Web/sites",
      "apiVersion": "2022-09-01",
      "name": "myAppService",
      "location": "[resourceGroup().location]",
      "kind": "app",
      "properties": {
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'myPlan')]"
      }
    }
  ]
}

You receive an error when deploying this ARM template: 'The serverFarmId property is required.' What is missing from the template?

⚠ Common exam trap

Many candidates think the error is about a missing property on the site resource itself (like location or kind), rather than realizing the entire server farm resource definition is absent from the template.

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 server farm resource (Microsoft.Web/serverfarms) is not defined in the template

The error 'The serverFarmId property is required' indicates that the ARM template is missing a reference to an App Service Plan (Microsoft.Web/serverfarms) resource. In Azure, a web app or function app must be associated with an App Service Plan, which defines the compute resources and pricing tier. The template must define the server farm resource and link it via the 'serverFarmId' property on the site resource.

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 server farm resource (Microsoft.Web/serverfarms) is not defined in the template

    Why this is correct

    Azure Web Apps (Microsoft.Web/sites) require an underlying App Service Plan, also known as a server farm (Microsoft.Web/serverfarms), to define the compute resources, pricing tier, and scale settings. If the web app resource attempts to reference a server farm that is not explicitly defined within the same ARM template or does not already exist in the target resource group, the deployment will fail with a dependency error. The web app's `serverFarmId` property typically uses a `resourceId` function to link to this plan, making its prior definition crucial.

  • The 'location' property is missing from the site resource

    Why it's wrong here

    The 'location' property is explicitly defined for the site resource using the `[resourceGroup().location]` expression. This ARM template function dynamically retrieves the location of the resource group into which the template is being deployed, ensuring the web app is created in the same Azure region. Therefore, the location property is not missing but correctly specified, making this option incorrect.

  • The apiVersion should be '2018-02-01'

    Why it's wrong here

    The `apiVersion` '2022-09-01' for `Microsoft.Web/sites` is a valid and relatively recent API version. While '2018-02-01' might also be valid, using a more current API version is generally recommended as it provides access to the latest features, bug fixes, and improvements for the resource type. There is no inherent requirement for the `apiVersion` to be '2018-02-01', and the specified version is perfectly acceptable for deployment.

  • The 'kind' property should be 'functionapp'

    Why it's wrong here

    The 'kind' property set to 'app' is correct for deploying a standard Azure Web App. If the intention were to deploy an Azure Function App, then 'functionapp' would be the appropriate value for the 'kind' property. However, for a general-purpose web application, 'app' correctly identifies the resource type, indicating that this option's assertion is incorrect.

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.