Is there a way how stop (and then start again) Azure Function from PowerShell?
2 Answers
Start-AzureRmWebApp
Start-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"
Stop-AzureRmWebApp
PS C:\>Stop-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"
Comments
Updated answer on 1/23/20
We have released a Preview module to managed Azure Functions. This can be found at https://www.powershellgallery.com/packages/Az.Functions/0.0.1-preview.
Please give it a try and send us feedback at https://github.com/Azure/azure-powershell/issues. When opening an issue, please make sure [Az.Functions] is included in the title.
To install the module, run the following command from the latest version of psws which can be downloaded at https://github.com/PowerShell/PowerShell/releases.
Install-Module -Name Az.Functions -AllowPrerelease
After installation, here is an example to stop a function app:
# 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
Cheers,
Francisco