nerdexam
MicrosoftMicrosoft

AZ-204 · Question #192

AZ-204 Question #192: Real Exam Question with Answer & Explanation

The correct answer is B: Add a PreBuild target in the websites csproj project file that runs the static content generation. B: ZIP package itself gets mounted directly as the read-only wwwroot directory (https://docs.microsoft.com/en-us/azure/app-service/deploy-run-package). Hence, it cannot generate static files from there. Meantime, using PreBuild is acceptable. D: To customize your deployment, incl

Submitted by alyssa_d· Mar 30, 2026

Question

You are preparing to deploy a website to an Azure Web App from a GitHub repository. The website includes static content generated by a script. You plan to use the Azure Web App continuous deployment feature. You need to run the static generation script before the website starts serving traffic. What are two possible ways to achieve this goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

Options

  • AAdd the path to the static content generation tool to WEBSITE_RUN_FROM_PACKAGE setting
  • BAdd a PreBuild target in the websites csproj project file that runs the static content generation
  • CCreate a file named run.cmd in the folder /run that calls a script which generates the static content
  • DCreate a file named .deployment in the root of the repository that calls a script which generates

Explanation

B: ZIP package itself gets mounted directly as the read-only wwwroot directory (https://docs.microsoft.com/en-us/azure/app-service/deploy-run-package). Hence, it cannot generate static files from there. Meantime, using PreBuild is acceptable. D: To customize your deployment, include a .deployment file in the repository root. You just need to add a file to the root of your repository with the name .deployment and the command = YOUR COMMAND TO RUN FOR DEPLOYMENT this command can be just running a script (batch file) that has all that is required for your deployment, like copying files from the repository to the web root directory for example. https://docs.microsoft.com/en-us/azure/app-service/deploy-local-git?tabs=cli https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-targets?view=vs-2022 ( for build pipeline in Azure DevOps)

Community Discussion

No community discussion yet for this question.

Full AZ-204 PracticeBrowse All AZ-204 Questions