azure app service does not restart after deployment through pipeline

Srikanth Vanam (PERSISTENT SYSTEMS LIMITED) 0 Reputation points Microsoft Vendor
2024-03-28T06:01:21.4233333+00:00

Hi team,

We are deploying our .NET code to the Azure App Service. However, our app service does not restart after successful deployment of our code.

We have to manually restart the app service. However, we do not wish to go through the process.

We want to restart the app service because API's do not get updated after our deployment.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,877 questions
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 2,535 Reputation points
    2024-03-28T08:40:40.8666667+00:00

    Hello Srikanth,
    Thanks for posting your question in the Microsoft Q&A forum.

    After the deployment process, consider utilizing the "Restart-AzWebAppSlot" command in PowerShell to restart the application. I hope this suggestion proves helpful to you.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

  2. VenkateshDodda-MSFT 18,281 Reputation points Microsoft Employee
    2024-03-28T10:09:44.6266667+00:00

    @Srikanth Vanam (PERSISTENT SYSTEMS LIMITED) Thank you for reaching out to Microsoft Q&A, apologize for any inconvenience any inconvenience caused on this.

    Thanks for your time over the offline discussion. I am summarizing our discussion and posting the same for the benefit of other community members.

    Issue : Customer is trying to deploy his application to app service using continuous deployment with azure devops pipeline through web deploy. Deployment is getting succeeded post restarting the app service manually they are able to see the published content. Also, customer want to know why the webdeploy didn't restarted the webapp.

    Solution:

    • Both Web deploy, Zip deploy deployment methods will restart the app service.
    • It is recommended to use Run from package, the files in the package are not copied to the wwwroot directory. Instead, the ZIP package itself gets mounted directly as the read-only wwwroot directory. Refer to this documentation for more information about run from package and its benefits.
    • Upon investigating deeper, we found that the customer's app service has local cache enabled. During deployment, the content in the remote storage or remote content share was updated, but it did not update the app service content folder. This is why the customer is unable to see the deployed content.
    • Suggested them to add one more CLI task in their azure devops release pipeline to restart the web app using the cmdlets az webapp restart or restart-azwebapp.

    Hope this helps, let me know if you have any further questions on this.

    0 comments No comments