【发布时间】:2019-05-16 12:41:34
【问题描述】:
有没有办法从 PowerShell 停止(然后重新启动)Azure Function?
【问题讨论】:
标签: azure powershell azure-functions
有没有办法从 PowerShell 停止(然后重新启动)Azure Function?
【问题讨论】:
标签: azure powershell azure-functions
启动-AzureRmWebApp
Start-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"
停止-AzureRmWebApp
PS C:\>Stop-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"
【讨论】:
20 年 1 月 23 日更新答案
我们发布了一个预览模块来托管 Azure Functions。这可以在https://www.powershellgallery.com/packages/Az.Functions/0.0.1-preview找到。
请试一试,并通过https://github.com/Azure/azure-powershell/issues 向我们发送反馈。打开问题时,请确保标题中包含[Az.Functions]。
要安装该模块,请从最新版本的psws 运行以下命令,该版本可以在https://github.com/PowerShell/PowerShell/releases 下载。
Install-Module -Name Az.Functions -AllowPrerelease
安装后,以下是停止功能应用的示例:
# Here is how you can stop a function app:
# 1) Stop a function app by name and resource group
Stop-AzFunctionApp -Name <FuntionAppName> -ResourceGroupName <ResourceGroupName>
# Stop a function app name using piping
Get-AzFunctionApp -Name <FuntionAppName> -ResourceGroupName <ResourceGroupName> |
| Stop-AzFunctionApp
干杯,
弗朗西斯科
【讨论】: