简体   繁体   English

如何从 Python 重新启动 Azure 应用服务槽?

[英]How can I restart an Azure App Service slot from Python?

I would like to restart a slot in my Azure Web application from Python.我想从 Python 重新启动 Azure Web 应用程序中的一个插槽。

How can I do that?我怎样才能做到这一点? I couldn't find anything about this in the official Python API: https://docs.microsoft.com/en-us/python/api/我在官方 Python API 中找不到任何关于此的信息: https : //docs.microsoft.com/en-us/python/api/

A workaround is to use the REST API exposed by the web application, but that's not quite what I need: https://docs.microsoft.com/en-us/rest/api/appservice/webapps/restartslot一种解决方法是使用 Web 应用程序公开的 REST API,但这并不是我所需要的: https : //docs.microsoft.com/en-us/rest/api/appservice/webapps/restartslot

Regards,问候,

There is a azure.mgmt.web module to manage web.有一个azure.mgmt.web模块来管理网络。

And in the WebAppsOperations class, there are restart and restart_slot method.WebAppsOperations类中,有restartrestart_slot方法。

Further more information, you could refer to this official doc: restart_slot .更多信息,你可以参考这个官方文档: restart_slot The description about this method is Restarts an app (or deployment slot, if specified).关于此方法的描述是Restarts an app (or deployment slot, if specified). . .

Suppose this is what you want.假设这是你想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从asp.net Azure应用服务调用python脚本? - How can I call a python script from an asp.net Azure app service? 如何从 Python 脚本以用户身份向 Azure 应用服务进行身份验证? - How can I authenticate as a user to Azure App Service from Python script? 如何从应用程序内部重新启动python应用程序 - How do I restart a python app from within the app itself 如何在Azure Web App Service Linux环境下安装自己的Python package? - How can I install my own Python package in Azure Web App Service Linux environment? 如何将Azure App Service Python版本从3.9.7更改为3.9.12? - How to change Azure App Service Python version from 3.9.7 to 3.9.12? 如何重新启动python 3脚本? - How can I restart my python 3 script? 如何在Azure应用服务中运行Python shell - How to run a Python shell in azure app service 我可以将Azure Service Relay与Python一起使用 - Can I use Azure Service Relay with Python 如何使用 Python function App 访问 Azure Sql 数据库? - How can i access Azure Sql Database with Python function App? 如何在 azure 中部署 python scrapy 项目? 它需要什么 azure 服务 [暂停] - How can i deploy python scrapy project in azure? what azure service is needed for it [on hold]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM