【问题标题】:How to create Microsoft.DBforPostgreSQL with Bicep?如何使用二头肌创建 Microsoft.DBforPostgreSQL?
【发布时间】:2021-12-09 14:21:18
【问题描述】:

我想为基于位置的服务需求创建 PostgreSQL。 接下来我会安装 GIS 扩展。

我已手动创建 Azure Database for PostgreSQL 灵活服务器来确定正确的配置。 "sku": {"name": "Standard_B1ms","tier": "Burstable"} 我想创建单服务器,但由于某种原因它在欧洲不可用。我认为缺少 Burstable 对初始 POC 有好处,但通用性也很好。

现在尝试用 Bicep 创建 PostgreSQL。 但是我很难设置有效的服务器。首先 Burstable 不可用。接下来我无法设置有效的 sku 名称。

az 部署组创建:

{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource 
deployment operation failed. Please list deployment operations for details. Please see 
https://aka.ms/DeployOperations for usage details.","details": 
[{"code":"BadRequest","message":"{\r\n  \"error\": {\r\n    \"code\": 
\"InvalidEditionSloCombination\",\r\n    \"message\": \"The edition 
GeneralPurpose does not support the service objective Standard_D2s_v3\"\r\n  }\r\n}"}]}}

main.二头肌:

resource symbolicname 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = {
  name: 'my-postgresql-dev'
  location: 'West Europe'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    name: 'Standard_D2s_v3' 
    tier: 'GeneralPurpose'
  }
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    administratorLogin: 'sqladmin'
    administratorLoginPassword: 'asfar43efw!sdf'
    storageProfile: {
      backupRetentionDays: 7
      geoRedundantBackup: 'Disabled'
      storageMB: 32000
    }
    version: '11'
    createMode: 'Default'
    // For remaining properties, see ServerPropertiesForCreate objects
  }
}

【问题讨论】:

    标签: azure azure-resource-manager azure-bicep azure-database-postgresql


    【解决方案1】:

    您收到的错误与sku名称有关:

    The edition GeneralPurpose does not support the service objective Standard_D2s_v3
    

    documentation,sku名称有特定的命名约定:

    sku 的名称,通常是 tier + family + cores,例如B_Gen4_1,GP_Gen5_8。

    在你的情况下,一般来说它将是 GP_GEN5_{核心数}。

    【讨论】:

      猜你喜欢
      • 2021-11-07
      • 2022-06-29
      • 2021-09-04
      • 2022-10-13
      • 2021-11-13
      • 1970-01-01
      • 1970-01-01
      • 2021-07-26
      • 1970-01-01
      相关资源
      最近更新 更多