我在尝试为 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
}
我尝试启用该功能
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"
}