为 AAD PostgreSQL 设置管理员

问题描述

二头肌版本

Bicep CLI 版本 0.3.255 (589f037)

描述错误

我正在尝试通过 Bicep 为 PostgreSQL 服务器设置 Active Directory 管理员。我能够创建 PostgreSQL 服务器,但没有关于类型的文档,例如 resource postgresqlActiveDirectoryAdmin 'Microsoft.DBforPostgreSQL/servers/administrators@2017-12-01'。 所以我决定导出一个手动设置了admin的资源的ARM模板,反编译成二头肌模板。

抛出的错误是一个错误请求

{
    "status": "Failed","error": {
        "code": "InvalidResourceIdSegment","message": "The 'parameters.properties' segment in the url is invalid.","details": [
            {
                "code": "InvalidResourceIdSegment","target": "parameters.properties","message": ""
            }
        ]
    }
}

复制 只需在 Bicep 中创建 PostgreSQL 服务器并尝试添加管理员,例如:

resource postgreSQL 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = {
  name: serverName
  identity: {
    type: 'SystemAssigned'
  }
  sku: {
    name: 'B_Gen5_1'
    tier: 'Basic'
    capacity: 1
    family: 'Gen5'
  }
  properties: {
    version: '11'
    sslEnforcement: 'Enabled'
    minimalTlsVersion: 'TLSEnforcementDisabled'
    infrastructureEncryption: 'Disabled'
    publicNetworkAccess: 'Enabled'
    storageProfile: {
      backupRetentionDays: 7
      geoRedundantBackup: 'Disabled'
      storageMB: 5120
      storageAutogrow: 'Disabled'
    }
    createMode: 'Default'
    administratorLogin: 'adminName'
    administratorLoginPassword: 's3cur3p455w0rd!' 
  }
  location: 'uksouth'
  tags: {}
  //resources: [] 
}


resource postgresqlActiveDirectoryAdmin 'Microsoft.DBforPostgreSQL/servers/administrators@2017-12-01' = {
  parent: postgreSQL
  name: 'activeDirectory'
  properties: {
    administratorType: 'ActiveDirectory'
    login: 'PostgresAdmin' //This is a Group in the Azure Directory
    sid: 'xxxxxxx' //grab SID(object id) of the group
    tenantId: 'xxxx' //tenant id
  }
}

文档中没有真正提到,所以只是依靠一些关于目前是否可行的知识?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...