Restart Web App

Handian Sudianto 4,956 Reputation points
2024-04-04T02:19:00.29+00:00

Hello, I need to restart specific azure web app on specific period every day. Can we restart the services using Web Job?

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

2 answers

Sort by: Most helpful
  1. Marcin Policht 23,545 Reputation points MVP
    2024-04-04T03:24:21.7766667+00:00

    In short, yes. Follow https://learn.microsoft.com/en-us/answers/questions/1355447/restart-azure-web-app-via-web-job-with-powershell

    Another option is to use an Azure Logic App. More at https://www.stevefenton.co.uk/blog/2020/07/start-and-stop-an-azure-app-service-on-a-schedule-with-azure-logic-apps/


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


  2. VenkateshDodda-MSFT 20,696 Reputation points Microsoft Employee
    2024-04-04T05:26:44.4333333+00:00

    Handian Sudianto Thanks for your response.

    • The above error occurred since by default the Azure PowerShell (Az) Cmdlets modules won't be available/installed on the app service worker instance.
    • Also, you won't be able to install the required PowerShell module since installation required to change the execution policy which needs admin privilege.

    Can you confirm have you followed all the steps suggested by @TP also are you running those cmdlets on azure automation account?

    If you are still facing the issue, can you try all the other alternative solution provided in the similar thread here.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.