[英]How to get the Virtual IP Address associated with a Azure App Service via Powershell
我正在尝试进行IP转换,并希望获得我们所有应用程序服务实例的虚拟IP。
到目前为止,我已经整理了以下powershell脚本:
$apps = Get-AzureRmWebApp
Foreach($app in $apps)
{
Write-Output "$($app.Name)|$($app.OutboundIpAddresses)"
($app | Get-AzureDeployment -Slot Production).VirtualIPs[0].Address
break;
}
但是我被困在Get-AzureDeployment步骤中-我认为应该有一个RM版本,但是我找不到它。
相关的GitHub问题-这表明它确实存在: https : //github.com/Azure/azure-powershell/issues/1648
我正在尝试按照以下屏幕截图访问虚拟IP地址:
如果要获取VIRTUAL IP ADDRESS
,可以使用以下命令。
$slot = Get-AzureRmWebAppSlot -ResourceGroupName "<ResourceGroupName>" -Name "<yourwebappname>" -Slot "<yourslotname>"
($slot.OutboundIpAddresses -split ",")[0]
您的完整命令应为:
$apps = Get-AzureRmWebApp
Foreach($app in $apps)
{
Write-Output "$($app.Name)|$($app.OutboundIpAddresses)"
$slot = Get-AzureRmWebAppSlot -ResourceGroupName $app.ResourceGroup -Name $app.Name -Slot "<yourslotname>"
($slot.OutboundIpAddresses -split ",")[0]
break;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.