gpt4 book ai didi

azure - 如何使用 Bicep 创建 Microsoft.DBforPostgreSQL?

转载 作者:行者123 更新时间:2023-12-03 02:18:06 28 4
gpt4 key购买 nike

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

我已手动创建 Azure Database for PostgreSQL 灵活服务器来决定正确的配置。"sku": {"name": "Standard_B1ms","tier": "突发"}我想创建单一服务器,但由于某种原因它在欧洲不可用。我认为缺少 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.bicep:

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

最佳答案

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

The edition GeneralPurpose does not support the service objective Standard_D2s_v3

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

The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.

在您的情况下,出于通用目的,它将是 GP_GEN5_{核心数}。

关于azure - 如何使用 Bicep 创建 Microsoft.DBforPostgreSQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70291539/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com