How to automatically restart an app service after certain time?

前端 未结 4 1181
时光说笑
时光说笑 2021-01-19 00:56

How to automatically restart an app service after 24 hours? How to schedule the app service to restart automatically at a specific time through the use of web jobs?

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 01:28

    We also could do that with Azure Rest API. About how to get access token please refer to azure document.

    POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart?api-version=2016-08-01&softRestart&synchronous={softRestart&synchronous}
    

    The following file types are accepted by WebJob:

    .cmd, .bat, .exe (using windows cmd)

    .ps1 (using powershell)

    .sh (using bash)

    .php (using php)

    .py (using python)

    .js (using node)

    .jar (using java)

    If C# is possible, there is a example using .Net library.

提交回复
热议问题