我可以制作一个 powershell 来在 WebJobs 的帮助下打开和关闭应用程序服务中的 AlwaysOn 属性吗?或者有没有更好的安排方法?

发布于 2025-01-15 21:19:03 字数 81 浏览 6 评论 0原文

我可以制作一个 powershell 来在 WebJobs 的帮助下打开/关闭应用程序服务中的 AlwaysOn 属性吗?或者有没有更好的安排方法?

Can I make a powershell that turns on/off the AlwaysOn property in the App service with help of WebJobs? Or is there better ways to schedule it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以心动 2025-01-22 21:19:03

您可以使用下面的 azure powershell 命令 Set-AzWebApp 来打开和关闭应用服务中的 AlwaysOn 属性。

Set-AzWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -AlwaysOn $true

此命令将修改 Azure Web 应用程序并确保 Web 应用程序始终加载,而不是在空闲后卸载。

Type: Boolean
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

You can use the below azure powershell command Set-AzWebApp to turn on and off the AlwaysOn property in the App service.

Set-AzWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -AlwaysOn $true

This cmd will Modify an Azure Web App and Ensure that web app gets loaded all the time, rather unloaded after been idle.

Type: Boolean
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文