1

Is there a way how stop (and then start again) Azure Function from PowerShell?

2 Answers 2

3

Start-AzureRmWebApp

Start-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"

https://learn.microsoft.com/en-us/powershell/module/azurerm.websites/start-azurermwebapp?view=azurermps-6.13.0

Stop-AzureRmWebApp

PS C:\>Stop-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp"

https://learn.microsoft.com/en-us/powershell/module/azurerm.websites/stop-azurermwebapp?view=azurermps-6.13.0

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.