Azure PostgresSQL:尝试添加VNET规则时出现错误:错误代码”FeatureSwitchNotEnabled”。

huangapple go评论83阅读模式
英文:

Azure PostgresSQL : Error: Code="FeatureSwitchNotEnabled" while trying to add VNET Rules

问题

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

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

我尝试启用以下功能:

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"
}

资源部分不需要翻译。

英文:

I am getting the following error while trying to add VNET Rules for Azure PostgresSQL database

> │ Virtual Network Rule Name: "allow-app-service-access-0"): performing
> CreateOrUpdate:
> virtualnetworkrules.VirtualNetworkRulesClient#CreateOrUpdate: Failure
> sending request: StatusCode=0 -- Original Error:
> Code="FeatureSwitchNotEnabled" Message="Requested feature is not
> enabled"

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
}

Azure PostgresSQL:尝试添加VNET规则时出现错误:错误代码”FeatureSwitchNotEnabled”。

I tried enabling the feature

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

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

and the status is

  {
    "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"
  } 

答案1

得分: 0

我必须在对VNET规则进行任何更改之前保存“拒绝公共网络访问”。

英文:

I had to save "Deny public network access" before I can make any changes into the VNET rules

Azure PostgresSQL:尝试添加VNET规则时出现错误:错误代码”FeatureSwitchNotEnabled”。

huangapple
  • 本文由 发表于 2023年7月11日 04:27:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76657131.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定