英文:
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
}
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规则进行任何更改之前保存“拒绝公共网络访问”。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论