我有一组通过二头肌部署的 Azure 应用服务。这些将使用专用端点作为后端服务。
我检查了资源管理器,将现有应用程序转储到 ARM 并将其转换为 Bicep,并搜索了所有文档,但我找不到有关“允许公共(public)访问”以及如何将其设置为的任何内容错误。
最佳答案
查看documentation ,您正在寻找此属性(自 api 版本 2020-12-01 起可用):
publicNetworkAccess: Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string.
刚刚使用 webapp 创建了一个新的应用程序服务计划,并且它正在运行。不确定现有的网络应用程序...
param appServicePlanName string = 'thomastest-nopublicaccess-asp'
param webAppName string = 'thomastest-nopublicaccess-wba'
resource appServicePlan 'Microsoft.Web/serverfarms@2018-11-01' = {
name: appServicePlanName
location: resourceGroup().location
sku: {
tier: 'PremiumV2'
name: 'P1V2'
}
properties: {
name: appServicePlanName
workerSize: 6
workerSizeId: 6
numberOfWorkers: 1
zoneRedundant: false
}
}
resource webApp 'Microsoft.Web/sites@2022-03-01' = {
name: webAppName
location: resourceGroup().location
properties: {
name: webAppName
serverFarmId: appServicePlan.id
httpsOnly: true
publicNetworkAccess: 'Disabled'
siteConfig: {
appSettings: []
metadata: [
{
name: 'CURRENT_STACK'
value: 'dotnet'
}
]
phpVersion: 'OFF'
netFrameworkVersion: 'v6.0'
alwaysOn: true
ftpsState: 'Disabled'
}
}
}
关于Azure 应用服务二头肌网络访问限制禁止公共(public)访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75598447/