diff --git a/_posts/2024-01-10-Deployment-Status-API-CLI.md b/_posts/2024-01-10-Deployment-Status-API-CLI.md new file mode 100644 index 000000000..ac4980e37 --- /dev/null +++ b/_posts/2024-01-10-Deployment-Status-API-CLI.md @@ -0,0 +1,63 @@ +--- +title: "Use Azure CLI to track the status of your code deployments" +author_name: "Tulika Chaudharie" +toc: true +toc_sticky: true +tags: + - Deployment +--- + +We are adding new capability to `az webapp deploy` allowing you to track the status of your code deployments. You can take advantage of more detailed information about the stages of your deployment using the `--track-status` option. + +Here are the steps to use it + +1. First, make sure you are using Azure CLI version [2.56.0](https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md) or greater. + + ```bash + az --version + ``` + + If your version is lower, you can upgrade using this command. + + ```bash + az upgrade + ``` + +2. Now, you can deploy your code and track status using the following command. The option `--track-status` will ensure that the polling API is setup for your deployment. Replace ``, ``, ``, `` and `` with your Web App name, resource group, repository path, the repository type and whether you want to run the deployment synchronously or not respectively. + + ```bash + az webapp deploy + --name '' \ + --resource-group '' \ + --src-path '' \ + --type='' \ + --async '' \ + --track-status + ``` + + For more information about [az webapp deploy](https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-deploy), please refer to the documentation. + +To give an example, this is the message you get if you run without the tracking option. + +**Without tracking** +![Deployment without tracking]({{site.baseurl}}/media/2024/01/deployment-without-tracking.jpg) + +Deployment has various steps to it - copying the code to our servers, building the code and copying the binaries and finally restarting the website so that it runs with the new binaries. From the message above, it was hard to determine which step failed. + +Now these are some snippets of the output for `--track-status` + +**Deployment Succeeded:** +![Deployment Successful]({{site.baseurl}}/media/2024/01/deployment-successful.jpg) + +**Build Failed:** +Here, the build of my code failed and therefore, deployment failed. The error message also gives you a link to the build logs for more detailed errors about the failure. + +![Build Failed]({{site.baseurl}}/media/2024/01/deployment-build-failed.jpg) + +**Site startup failed after deployment:** +Once the build is done, the API checks to see if the site is restarted. It keeps polling for 10 minutes for the site to startup and gives an error if it does not start in that time. You can look at your site logs to determine why your site failed to startup in 10 minutes. + +![Runtime Failed]({{site.baseurl}}/media/2024/01/deployment-runtime-failed.jpg) + +**Conclusion:** +At present, this feature is available only for Linux App Service code deployments. This is a platform improvement and our roadmap includes extending this functionality to other deployment clients such as GitHub and Visual Studio. Stay tuned for forthcoming updates as we continue our efforts to smoothen your deployment journey on Azure App Service. \ No newline at end of file diff --git a/media/2024/01/deployment-build-failed.jpg b/media/2024/01/deployment-build-failed.jpg new file mode 100644 index 000000000..9008cd886 Binary files /dev/null and b/media/2024/01/deployment-build-failed.jpg differ diff --git a/media/2024/01/deployment-runtime-failed.jpg b/media/2024/01/deployment-runtime-failed.jpg new file mode 100644 index 000000000..19c99e073 Binary files /dev/null and b/media/2024/01/deployment-runtime-failed.jpg differ diff --git a/media/2024/01/deployment-successful.jpg b/media/2024/01/deployment-successful.jpg new file mode 100644 index 000000000..3efa186c2 Binary files /dev/null and b/media/2024/01/deployment-successful.jpg differ diff --git a/media/2024/01/deployment-without-tracking.jpg b/media/2024/01/deployment-without-tracking.jpg new file mode 100644 index 000000000..5a89511a1 Binary files /dev/null and b/media/2024/01/deployment-without-tracking.jpg differ