Azure PostgresSQL:尝试添加 VNET 规则时出现错误:Code="FeatureSwitchNotEnabled"

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

我在尝试为 Azure PostgresSQL 数据库添加 VNET 规则时收到以下错误

│虚拟网络规则名称:“allow-app-service-access-0”):执行 创建或更新: virtualnetworkrules.VirtualNetworkRulesClient#CreateOrUpdate:失败 发送请求:StatusCode=0 -- 原始错误: Code="FeatureSwitchNotEnabled" Message="请求的功能未启用 已启用”

resource "azurerm_postgresql_virtual_network_rule" "allow_app_service_access" {
  count = length(var.subnet_whitelist)

  name                                 = "allow-app-service-access-${count.index}"
  resource_group_name                  = var.resource_group_name
  server_name                          = azurerm_postgresql_server.app_postgres_server.name
  subnet_id                            = var.subnet_whitelist[count.index]
  ignore_missing_vnet_service_endpoint = true
}

enter image description here

我尝试启用该功能

az feature register --namespace Microsoft.DBforPostgreSQL  --name "firewallRuleAllowAzureServices"

az feature register --namespace Microsoft.DBforPostgreSQL  --name "vnet"

状态是

  {
    "id": "/subscriptions/id/providers/Microsoft.Features/providers/Microsoft.DBforPostgreSQL/features/firewallRuleAllowAzureServices",
    "name": "Microsoft.DBforPostgreSQL/firewallRuleAllowAzureServices",
    "properties": {
      "state": "Pending"
    },
    "type": "Microsoft.Features/providers/features"
  },
  {
    "id": "/subscriptions/id/providers/Microsoft.Features/providers/Microsoft.DBforPostgreSQL/features/vnet",
    "name": "Microsoft.DBforPostgreSQL/vnet",
    "properties": {
      "state": "Pending"
    },
    "type": "Microsoft.Features/providers/features"
  } 
azure azure-postgresql
2个回答
0
投票

我必须先保存“拒绝公共网络访问”,然后才能对 VNET 规则进行任何更改

enter image description here


0
投票

这有效! 谢谢你!更改了我的 Terraform 以允许公共访问进行测试,并且 VNET 规则现已创建!

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