AZ-204 · Question #192
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…
The correct answer is B. Add a PreBuild target in the websites csproj project file that runs the static content generation D. Create a file named .deployment in the root of the repository that calls a script which generates. 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…
Question
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
How the community answered
(53 responses)- A15% (8)
- B79% (42)
- C6% (3)
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)
Topics
Community Discussion
No community discussion yet for this question.