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