Azure 应用服务二头肌网络访问限制禁止公共(public)访问

标签 azure azure-resource-manager azure-appservice azure-bicep

我有一组通过二头肌部署的 Azure 应用服务。这些将使用专用端点作为后端服务。

我检查了资源管理器,将现有应用程序转储到 ARM 并将其转换为 Bicep,并搜索了所有文档,但我找不到有关“允许公共(public)访问”以及如何将其设置为的任何内容错误。

如何在“网络”部分下将“允许公共(public)访问”设置为 false? enter image description here

最佳答案

查看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/

相关文章:

azure - 独立扩展 Azure 函数(单个函数)

Azure 应用服务 ARM 模板部署 - 如何删除现有的主机名绑定(bind)?

azure - 无法使用 Microsoft.Azure.Management.ResourceManager.Fluent 命名空间中的 ResourceManagementClient 类发现 Azure 资源

azure - 将 Azure 证书移动到另一个订阅时出错 : Property id '' at path 'properties.keyVaultId' is invalid

azure - 应用程序设置 - Azure 应用程序服务(多个环境)

Azure SQL Azure AD 身份验证失败

macos - 在 Mac OS 上开发通知中心 - NodeJS/.Net Core 支持似乎已弃用

azure - 是否可以通过 HTTP 请求 header 确认机器人的身份?

azure - 用于具有托管身份的事件网格 API 连接的 ARM 模板

c# - Visual Studio 2022 发布窗口警告我有关 Azure 应用服务不支持 Win-x64