simoneL
simoneL

Reputation: 622

How to read the name of the App Service Plan used an App Service with Azure Powershell

Given the name of an Azure App Service, I want to be able to find the name of the App Service plan. I've inspected the object returned by Get-WebApp but it doesn't contain any reference to the App Service Plan used.

Upvotes: 1

Views: 1380

Answers (2)

Péter Szilvási
Péter Szilvási

Reputation: 2009

Using bash script and Azure CLI, run the following command:

az functionapp show --name <function_app> --resource-group <resource_group> --query "properties.serverFarmId"

The above script will extract the serverFarmId property.

Upvotes: 0

4c74356b41
4c74356b41

Reputation: 72171

you can use this bit:

Get-AzWebApp | Select-Object name, serverfarmid

this will return Web App name and the Service Plan Id.

( Get-AzWebApp | Select-Object -ExpandProperty ServerFarmId ) -split '/' | Select-Object -Last 1

Upvotes: 1

Related Questions