Courseiva
Develop Azure compute solutionshardMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

You are deploying a Java application to Azure App Service on Linux. The application requires a specific JDK version not available in the built-in stack. You need to provide the JDK without creating a custom container. What should you do?

⚠ Common exam trap

Many exam-takers think mounting a file share (Option A) is the simplest way to provide custom binaries, but they overlook that App Service on Linux does not support mounting Azure Files for executable files, and the startup script approach is the documented method for custom runtimes.

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

Use a startup script to download and set JAVA_HOME

Azure App Service on Linux allows you to use a startup script to download a custom JDK and set the JAVA_HOME environment variable before the application starts. This approach avoids the need for a custom container while providing the specific JDK version required by the application.

Answer analysis

Option-by-option breakdown

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

  • Mount an Azure Files share containing the JDK

    Why it's wrong here

    While technically possible to mount an Azure Files share to an App Service container and place a JDK there, this approach introduces unnecessary complexity and management overhead. App Service on Linux provides more integrated methods for managing Java runtimes. This method would require manual configuration of the JDK on the share, ensuring correct permissions, and explicitly setting JAVA_HOME and PATH environment variables within the container's startup script, which is less efficient than leveraging built-in App Service capabilities.

  • Use the Azure App Service Windows stack with a custom JDK

    Why it's wrong here

    This option is incorrect because the question explicitly states the deployment is to "Azure App Service on Linux." Utilizing the Windows stack would fundamentally change the underlying operating environment and container technology, which directly contradicts the problem's specified requirement. Azure App Service on Windows uses a different architecture, including IIS, and is not compatible with a Linux-based deployment scenario.

  • Use a startup script to download and set JAVA_HOME

    Why this is correct

    Azure App Service on Linux allows you to specify a custom startup command or script that executes before your application starts. This script provides a robust mechanism to download a specific JDK version (e.g., from a trusted URL or Azure Blob Storage), install it into the container's file system, and then correctly configure critical environment variables such as JAVA_HOME and PATH. This approach offers significant flexibility to use a precise JDK version not pre-installed on the base image, ensuring application compatibility without the overhead of a full custom Docker image.

  • Create a custom Docker container and deploy to App Service

    Why it's wrong here

    The question explicitly states that the solution should be achieved "without creating a custom container." While deploying a custom Docker image with a pre-configured JDK is a highly effective and common approach for complex Java applications on App Service, it directly violates a key constraint provided in the problem statement. Therefore, despite its technical feasibility and common use, this option is incorrect based on the specific requirements.

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.