创建和监视迁移所需的权限

适用于: Azure Database for PostgreSQL 灵活服务器

若要使用 PostgreSQL 迁移服务创建和监视迁移,用户需要特定的权限。 以下指南阐述了所需权限和有效配置这些权限的步骤。

最小权限集

以下权限是用户成功创建和监视迁移所需的最低权限:

  • 资源组和订阅权限

    • Microsoft.Resources/subscriptions/resourceGroups/read
    • Microsoft.Resources/subscriptions/read
    • Microsoft.Resources/subscriptions/locations/read
    • Microsoft.Resources/subscriptions/resourceGroups/deployments/read
    • Microsoft.Resources/deployments/read
    • Microsoft.Resources/subscriptions/resourceGroups/resources/read
  • 特定于迁移的权限

    • Microsoft.DBforPostgreSQL/flexibleServers/checkMigrationNameAvailability/action
    • Microsoft.DBforPostgreSQL/flexibleServers/migrations/write
    • Microsoft.DBforPostgreSQL/flexibleServers/migrations/read
    • Microsoft.DBforPostgreSQL/flexibleServers/migrations/delete
  • 灵活服务器访问权限

    • Microsoft.DBforPostgreSQL/flexibleServers/read
    • Microsoft.DBforPostgreSQL/flexibleServers/databases/read
  • 源服务器访问权限(仅单一服务器源需要)

    • Microsoft.DBforPostgreSQL/servers/read
    • Microsoft.DBforPostgreSQL/servers/administrators/read
    • Microsoft.DBforPostgreSQL/servers/databases/read
  • 连接和数据库列表操作

    • Microsoft.DBforPostgreSQL/flexibleServers/testConnectivity/action
    • Microsoft.DBforPostgreSQL/flexibleServers/getSourceDatabaseList/action
  • 配置访问权限

    • Microsoft.DBforPostgreSQL/flexibleServers/configurations/read
    • Microsoft.DBforPostgreSQL/servers/configurations/read

默认角色

默认情况下,订阅级别的特权管理员角色(例如“所有者”或“参与者”)具有必要的权限

分配用于迁移的自定义角色

如果要专门授予用于创建和监视迁移的权限,而不授予其他数据库管理员权限,请考虑创建自定义角色。

运行时服务器迁移的其他要求

如果运行时服务器是迁移设置的一部分,请确保运行时服务器范围内包含 Microsoft.DBforPostgreSQL/flexibleServers/migrations/* 的权限。

通过设置这些权限,可确保迁移过程既安全又符合 PostgreSQL 迁移服务要求。