Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何读取使用Azure Powershell的应用程序服务的应用程序服务计划的名称_Azure_Azure Web App Service_Azure Powershell - Fatal编程技术网

如何读取使用Azure Powershell的应用程序服务的应用程序服务计划的名称

如何读取使用Azure Powershell的应用程序服务的应用程序服务计划的名称,azure,azure-web-app-service,azure-powershell,Azure,Azure Web App Service,Azure Powershell,给定Azure应用程序服务的名称,我希望能够找到应用程序服务计划的名称。 我已检查Get WebApp返回的对象,但它不包含对所用应用服务计划的任何引用。您可以使用此位: Get-AzWebApp | Select-Object name, serverfarmid 这将返回Web应用程序名称和服务计划Id ( Get-AzWebApp | Select-Object -ExpandProperty ServerFarmId ) -split '/' | Select-Object -Last

给定Azure应用程序服务的名称,我希望能够找到应用程序服务计划的名称。 我已检查Get WebApp返回的对象,但它不包含对所用应用服务计划的任何引用。

您可以使用此位:

Get-AzWebApp | Select-Object name, serverfarmid
这将返回Web应用程序名称和服务计划Id

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

我也注意到了ServerFarmId,但这不仅仅是应用服务计划的名称。问题是,我需要这个名称,以便能够使用Get-AzAppServicePlan命令检索应用程序服务计划。我唯一能做的就是对字符串进行拆分,以获得我需要的ID部分