我正试图通过powershell获得应用程序服务的所有IP限制,我能够为webappname.azurewebsites.net获得IP限制,但我也想为kudu控制台或SCM网站获取IP限制,有什么方法可以这样做吗?
发布于 2020-05-14 09:58:36
您可以编辑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
}
}https://stackoverflow.com/questions/61792579
复制相似问题