You will deploy a website from GitHub to an Azure Web App and need to run a static content generation script before the site begins serving traffic. Which two approaches will ensure the script runs prior to serving? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Add a PreBuild target in the website's .csproj that executes the static generation script., Add a .deployment file in the repository root that invokes a script to generate the static content and deploy the site..
Why this is the answer
A PreBuild target in the .csproj file is a standard .NET build mechanism that executes specified commands before the main build process. This ensures your static content is generated as part of the application build, prior to deployment. A .deployment file in the repository root is a custom deployment script for Azure App Service. It allows you to define specific commands to run during the deployment process, including static content generation, before the application is made live. The WEBSITERUNFROMPACKAGE setting in host.json is for Azure Functions and controls how the function app runs from a deployment package, not for executing pre-deployment scripts for a web app. Creating a run.cmd in a /run folder is not a standard or supported method for triggering pre-deployment scripts in Azure App Service deployments.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed