如何获得Azure App Service scm网站或kudu控制台的IP限制

问题描述 投票:0回答:1

我正在尝试通过Powershell获得对应用程序服务的所有IP限制,我能够为webappname.azurewebsites.net获得IP限制,但是我想获取kudu控制台或SCM网站的IP限制,还有什么方法可以做到这一点?

azure-powershell
1个回答
0
投票
您可以将SO answer编辑为$WebAppConfig.Properties.scmIpSecurityRestrictions,以显示您订阅中的所有SCM站点IP限制。

$APIVersion = ((Get-azResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions[0] $WebApps = Get-azWebApp foreach ($webApp in $WebApps) { $WebAppName = $WebApp.Name $WebAppRGName = $webApp.ResourceGroup $WebAppConfig = (Get-azResource -ResourceType Microsoft.Web/sites/config -ResourceName $WebAppName -ResourceGroupName $WebAppRGName -ApiVersion $APIVersion) $scmIpSecurityRestrictions = $WebAppConfig.Properties.scmIpSecurityRestrictions if ($scmIpSecurityRestrictions -eq $null) { Write-Host "No SCM site IP restrictions found for WebApp $WebAppName ." } else { Write-Host "SCM site IP restrictions set for WebApp $WebAppName : " $scmIpSecurityRestrictions } }

© www.soinside.com 2019 - 2024. All rights reserved.