2017-04-02 101 views
5

以任何方式以编程方式重新启动Azure Web App,即Kudu或其他类型?如何以编程方式重新启动Azure Web App

我发现可以使用管理库,但它不适用于我,因为我无法在AD中创建应用程序。

+0

[电源外壳(https://docs.microsoft.com/en-us/powershell/resourcemanager/azurerm.websites/v2.7.0/restart-azurermwebapp)的伟大工程! – trevorc

回答

8

Powershell的:

Restart-AzureRmWebApp -ResourceGroupName xxx -Name xxx 

或使用提供者操作:

Invoke-AzureRmResourceAction -ResourceGroupName xxx -ResourceType 'Microsoft.Web/sites' -ResourceName xxx ` 
    -ApiVersion '2015-08-01' -Action 'Restart' -Force 

天青CLI:

azure webapp restart --resource-group xxx --name xxx 

天青的Python CLI:

az appservice web restart --resource-group xxx --name xxx 

,或者您可以使用Rest Api

+1

有关使用.NET库的示例,另请参阅[this](https://github.com/davidebbo/AzureWebsitesSamples/blob/bf195e051935a6db3db196c63d9e8a124fc12aa9/ManagementLibrarySample/Program.cs#L295)。 –

+1

大卫你好!谢谢,我已经看到您的博客,我有一个问题:我可以在不创建AD应用程序的情况下执行此操作吗?我已经有了Web App。 –

相关问题