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.
Click on the arrows to vote for the correct answer
A. B. C. D.AD.
A: In Azure, you can run your functions directly from a deployment package file in your function app.
The other option is to deploy your files in the d:\home\site \wwwroot directory of your function app (see A above)
To enable your function app to run from a package, you just add a WEBSITE_RUN_FROM_PACKAGE setting to your function app settings.
Note: The host.json metadata file contains global configuration options that affect all functions for a function app.
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 content: [config] 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://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script https://docs.microsoft.com/bs-latn-ba/azure/azure-functions/run-functions-from-deployment-packageSure, I'd be happy to explain the possible ways to achieve the goal of running a static content generation script before serving traffic on an Azure Web App deployed from a GitHub repository.
Option A: The first way is to add the path to the static content generation tool to the WEBSITE_RUN_FROM_PACKAGE setting in the host.json file. The WEBSITE_RUN_FROM_PACKAGE setting tells Azure to deploy the application code as a package, which can include pre-built binaries, compiled code, or scripts. By adding the path to the static content generation tool in the host.json file, you can ensure that the tool is run before the website starts serving traffic. When Azure deploys the website, it will first run the static content generation script as part of the deployment process.
Option B: The second way is to add a PreBuild target in the website's csproj project file that runs the static content generation script. The PreBuild target is a build step that runs before the website is built and deployed. By adding a PreBuild target that runs the static content generation script, you can ensure that the script is run before the website is built and deployed. This approach gives you more control over the build and deployment process, as you can customize the build steps and specify dependencies between different steps.
Option C: The third way is to create a file named run.cmd in the folder /run that calls a script which generates the static content and deploys the website. The /run folder is a special folder in Azure Web Apps that contains scripts that are run during the deployment process. By creating a run.cmd file in this folder and specifying a script that generates the static content and deploys the website, you can ensure that the script is run before the website starts serving traffic.
Option D: The fourth way is to create a file named .deployment in the root of the repository that calls a script which generates the static content and deploys the website. The .deployment file is a special file that tells Azure Web Apps how to deploy the website. By creating a .deployment file in the root of the repository and specifying a script that generates the static content and deploys the website, you can ensure that the script is run before the website starts serving traffic.
Overall, all of these options achieve the goal of running a static content generation script before serving traffic on an Azure Web App deployed from a GitHub repository. The choice between them depends on your specific requirements and the level of control you need over the build and deployment process.