Courseiva
Develop Azure compute solutionseasyMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

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"
    }
  }
}

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?

⚠ Common exam trap

A common mix-up: candidates confuse 'webSocketsEnabled' with other networking or protocol settings like HTTP/2 or alwaysOn, assuming WebSockets are automatically supported or require a different configuration flag.

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

Add 'webSocketsEnabled': true to siteConfig.

The 'webSocketsEnabled' property in the siteConfig of an Azure App Service ARM template explicitly enables WebSocket protocol support. WebSocket connections require a persistent, full-duplex communication channel over a single TCP connection, which is not enabled by default in Azure App Service. Setting this property to true allows the app to handle real-time features like chat or live notifications.

Answer analysis

Option-by-option breakdown

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

  • Set alwaysOn to false.

    Why it's wrong here

    Setting "alwaysOn" to "false" would allow the Azure App Service application to be unloaded from memory after a period of inactivity. While this saves resources, it does not directly affect the App Service's capability to support the WebSocket protocol itself. Instead, it could lead to initial connection delays or disruptions for WebSocket clients as the application needs to "wake up" before processing requests, but it doesn't disable the underlying WebSocket feature.

  • Set http20Enabled to false.

    Why it's wrong here

    HTTP/2 is an evolution of the HTTP protocol designed for improved performance and multiplexing of traditional HTTP requests. WebSockets, however, establish a persistent, full-duplex communication channel that is initiated via an HTTP upgrade request, typically over HTTP/1.1 or HTTP/2.1. Disabling HTTP/2 would not prevent WebSocket connections from being established, as the initial handshake can still occur over HTTP/1.1, which is generally supported by default. The two protocols operate independently in this context.

  • Change ftpsState to AllAllowed.

    Why it's wrong here

    The "ftpsState" property in Azure App Service configuration specifically controls the security and availability of the File Transfer Protocol Secure (FTPS) endpoint for deploying and managing application files. Setting it to "AllAllowed" permits all FTPS connections, including insecure ones. This setting is entirely unrelated to the runtime network protocols used by the deployed web application, such as WebSocket communication, which facilitates real-time client-server interaction.

  • Add 'webSocketsEnabled': true to siteConfig.

    Why this is correct

    For an Azure App Service to properly support and route WebSocket traffic, the "webSocketsEnabled" property must be explicitly set to "true" within the "siteConfig" section of the ARM template. This configuration instructs the underlying Azure platform to enable the necessary infrastructure for WebSocket connections, allowing the initial HTTP upgrade handshake to succeed and establish persistent, full-duplex communication channels between clients and the application. Without this setting, WebSocket connections will fail.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

About these practice questions

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.