az postgres flexible-server
Note
此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 Learn more about extensions.
管理 Azure Database for PostgreSQL 灵活服务器。
命令
az postgres flexible-server connect
连接到灵活服务器。
az postgres flexible-server connect --admin-user
--name
[--admin-password]
[--database-name]
[--interactive]
[--querytext]
必需参数
管理员的登录用户名。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
管理员的登录密码。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
数据库的名称。
传递此参数以在交互模式下连接到数据库。
参数“querytext”已弃用,将在将来的版本中删除。 请改用“执行”。
要针对灵活服务器运行的查询。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server create
创建 PostgreSQL 灵活服务器。
使用自定义或默认配置创建 PostgreSQL 灵活服务器。 有关网络配置的详细信息,请参阅
az postgres flexible-server create [--address-prefixes]
[--admin-display-name]
[--admin-object-id]
[--admin-password]
[--admin-type {Group, ServicePrincipal, Unknown, User}]
[--admin-user]
[--backup-identity]
[--backup-key]
[--backup-retention]
[--cluster-option {ElasticCluster, Server}]
[--create-default-database {Disabled, Enabled}]
[--database-name]
[--geo-redundant-backup {Disabled, Enabled}]
[--high-availability {Disabled, SameZone, ZoneRedundant}]
[--identity]
[--iops]
[--key]
[--location]
[--microsoft-entra-auth {Disabled, Enabled}]
[--name]
[--node-count]
[--password-auth {Disabled, Enabled}]
[--performance-tier]
[--private-dns-zone]
[--public-access]
[--resource-group]
[--sku-name]
[--standby-zone]
[--storage-auto-grow {Disabled, Enabled}]
[--storage-size]
[--storage-type {PremiumV2_LRS, Premium_LRS}]
[--subnet]
[--subnet-prefixes]
[--tags]
[--throughput]
[--tier]
[--version]
[--vnet]
[--yes]
[--zone]
示例
使用自定义参数创建 PostgreSQL 灵活服务器
az postgres flexible-server create --location northeurope --resource-group testGroup \
--name testserver --admin-user username --admin-password password \
--sku-name Standard_D2s_v3 --tier GeneralPurpose --public-access 153.24.26.117 --storage-size 128 \
--tags "key=value" --version 17 --high-availability ZoneRedundant --zone 1 \
--standby-zone 3
使用高级 SSD v2 磁盘创建 PostgreSQL 灵活服务器。
# set storage type to "PremiumV2_LRS" and provide values for Storage size (in GiB), IOPS (operations/sec), and Throughput (MB/sec).
az postgres flexible-server create --location northeurope --resource-group testGroup \
--name testserver --admin-user username --admin-password password \
--sku-name Standard_B1ms --tier Burstable --storage-type PremiumV2_LRS --storage-size 128 --iops 3000 --throughput 125
创建默认参数和启用公共访问的 PostgreSQL 灵活服务器。 资源组、服务器名称、用户名、密码和默认数据库将由 CLI 创建
az postgres flexible-server create
创建具有公共访问权限的 PostgreSQL 灵活服务器,并添加 IP 地址范围以有权访问此服务器。 --public-access 参数可以是“Disabled”、“Enabled”、“All”、“None”或 <startIpAddress><startIpAddress>-<endIpAddress>
az postgres flexible-server create --resource-group testGroup --name testserver --public-access 125.23.54.31-125.23.54.35
创建具有专用访问权限的 PostgreSQL 灵活服务器。 如果提供的虚拟网络和子网不存在,则会创建具有指定地址前缀的虚拟网络和子网。
az postgres flexible-server create --resource-group testGroup --name testserver --vnet myVnet --subnet mySubnet --address-prefixes 10.0.0.0/16 --subnet-prefixes 10.0.0.0/24
使用新的子网资源 ID 和新的专用 DNS 区域资源 ID 创建 PostgreSQL 灵活服务器。 可以在不同的订阅或资源组中创建子网和 DNS 区域。
az postgres flexible-server create \
--resource-group testGroup --name testserver \
--subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} \
--private-dns-zone /subscriptions/{SubID}/resourceGroups/{resourceGroup}/providers/Microsoft.Network/privateDnsZones/testPostgreSQLFlexibleDnsZone.private.postgres.database.azure.com \
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24
使用同一资源组中的现有网络资源创建 PostgreSQL 灵活服务器。 提供的子网不应在其中部署任何其他资源,并且此子网将委派给 Microsoft.DBforPostgreSQL/flexibleServers(如果尚未委派)。 如果尚未链接,专用 DNS 区域将链接到虚拟网络。
# create vnet
az network vnet create --resource-group testGroup --name testVnet --location testLocation --address-prefixes 172.0.0.0/16
# create subnet
az network vnet subnet create --resource-group testGroup --vnet-name testVnet --address-prefixes 172.0.0.0/24 --name testSubnet
# create private dns zone
az network private-dns zone create -g testGroup -n testDNS.private.postgres.database.azure.com
az postgres flexible-server create --resource-group testGroup \
--name testserver --location testLocation \
--subnet /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com\
az postgres flexible-server create --resource-group testGroup --name testserver \
--vnet testVnet --subnet testSubnet --location testLocation \
--private-dns-zone /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com
使用不同资源组/订阅中的现有网络资源创建 PostgreSQL 灵活服务器。
az postgres flexible-server create --resource-group testGroup \
--name testserver --location testLocation \
--subnet /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/virtualNetworks/tesetVnet/subnets/testSubnet \
--private-dns-zone /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com
使用数据加密创建 PostgreSQL 灵活服务器。
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create flexible server with data encryption enabled
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--key $keyIdentifier --identity testIdentity
使用 Microsoft Entra 身份验证和密码身份验证创建 PostgreSQL 灵活服务器。
# create flexible server with aad auth and password auth enabled
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--microsoft-entra-auth Enabled
创建仅Microsoft Entra 身份验证和主要管理员指定的 PostgreSQL 灵活服务器。
# create flexible server with aad only auth and password auth disabled with primary administrator specified
az postgres flexible-server create -g testGroup -n testServer --location testLocation \
--microsoft-entra-auth Enabled --password-auth Disabled \
--admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name john@contoso.com --admin-type User
创建启用了公共访问、异地冗余备份的 PostgreSQL 灵活服务器,并添加 IP 地址范围,以访问此服务器。 --public-access 参数可以是“All”、“None”或 <startIpAddress><startIpAddress>-<endIpAddress>
az postgres flexible-server create --resource-group testGroup --name testserver --geo-redundant-backup Enabled --public-access 125.23.54.31-125.23.54.35
为启用了异地运行备份的服务器创建具有数据加密的 PostgreSQL 灵活服务器。
# create keyvault
az keyvault create -g testGroup -n testVault --location testLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
keyIdentifier=$(az keyvault key create --name testKey -p software \
--vault-name testVault --query key.kid -o tsv)
# create identity and save its principalId
identityPrincipalId=$(az identity create -g testGroup --name testIdentity \
--location testLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n testVault --object-id $identityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create keyvault in geo-paired region
az keyvault create -g testGroup -n geoVault --location geoPairedLocation \
--enable-purge-protection true
# create key in keyvault and save its key identifier
geoKeyIdentifier=$(az keyvault key create --name geoKey -p software \
--vault-name geoVault --query key.kid -o tsv)
# create identity in geo-raired location and save its principalId
geoIdentityPrincipalId=$(az identity create -g testGroup --name geoIdentity \
--location geoPairedLocation --query principalId -o tsv)
# add testIdentity as an access policy with key permissions 'Wrap Key', 'Unwrap Key', 'Get' and 'List' inside testVault
az keyvault set-policy -g testGroup -n geoVault --object-id $geoIdentityPrincipalId \
--key-permissions wrapKey unwrapKey get list
# create flexible server with data encryption enabled for geo-backup Enabled server
az postgres flexible-server create -g testGroup -n testServer --location testLocation --geo-redundant-backup Enabled \
--key $keyIdentifier --identity testIdentity --backup-key $geoKeyIdentifier --backup-identity geoIdentity
使用自定义存储性能层创建灵活服务器。 接受的值“P4”、“P6”、“P10”、“P15”、“P20”、“P30”、“\”P40“、”P50“、”P60“、”P70“、”P80”。 实际允许的值取决于灵活服务器创建的 --storage 大小选择。 \ 存储性能层的默认值取决于为灵活服务器创建选择的 --storage 大小。
az postgres flexible-server create -g testGroup -n testServer --location testLocation --performance-tier P15
创建存储自动增长为“已启用”的灵活服务器。 接受的值已启用/已禁用。 存储自动增长的默认值为“已禁用”。
az postgres flexible-server create -g testGroup -n testServer --location testLocation --storage-auto-grow Enabled
创建节点计数为 5 的弹性群集。 当 --cluster-option 为“ElasticCluster”时,默认节点计数为 2。
az postgres flexible-server create -g testGroup -n testCluster --location testLocation --cluster-option ElasticCluster --node-count 5
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
以 CIDR 格式创建新虚拟网络时要使用的 IP 地址前缀。 默认值为 10.0.0.0/16。
Microsoft Entra 管理员用户或组的显示名称。
Microsoft Entra 管理员的唯一 ID。
管理员的密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下类别中的三个类别的字符:英文大写字母、英文小写字母、数字和非字母数字字符。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
Microsoft Entra 管理员的类型。
属性 | 值 |
---|---|
接受的值: | Group, ServicePrincipal, Unknown, User |
服务器的管理员用户名。 设置后,无法更改它。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
默认值: | pickysyrup7 |
用于数据加密的异地备份用户标识的名称或资源 ID。 标识需要与备份区域位于同一区域。
用于数据加密的异地备份 keyvault 密钥的资源 ID。 密钥需要与备份区域位于同一区域。
备份保留的天数。 范围为 7 到 35 天。 默认值为 7 天。
属性 | 值 |
---|---|
默认值: | 7 |
服务器的群集选项。 服务器适用于可以容纳在一个节点上的工作负荷。 弹性群集在数据库上提供基于架构的分片和基于行的分片。 默认值为 Server。
属性 | 值 |
---|---|
默认值: | Server |
接受的值: | ElasticCluster, Server |
启用或禁用创建默认数据库 flexibleserverdb。 默认值为 Disabled。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
预配数据库服务器时要创建的数据库的名称。 数据库名称必须以字母 (a-z) 或下划线 (_) 开头。 名称中的后续字符可以是字母、数字(0-9)、连字符(-)或下划线。 数据库名称长度必须小于 64 个字符。
是否启用异地冗余备份。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
启用(ZoneRedundant 或 SameZone)或禁用高可用性功能。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, SameZone, ZoneRedundant |
用于数据加密的用户分配的标识的名称或资源 ID。
要为此服务器分配的 IOPS(作/秒)的值。 仅当灵活服务器使用高级 SSD v2 磁盘时,才能更新此值。
用于数据加密的主密钥库密钥的资源 ID。
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
是否启用Microsoft Entra 身份验证。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
弹性群集的节点数。 范围为 1 到 10。 默认值为 2 个节点。
是否启用密码身份验证。
属性 | 值 |
---|---|
默认值: | Enabled |
接受的值: | Disabled, Enabled |
服务器的性能层。
此参数仅适用于具有专用访问权限的服务器。 新的或现有的专用 DNS 区域的名称或 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 如果要使用不同资源组或订阅中的区域,请提供资源 ID。CLI 会在与虚拟网络相同的资源组中创建新的专用 DNS 区域(如果未由用户提供)。
确定公共访问。 输入要包含在 IP 允许列表中的单个或一系列 IP 地址。 IP 地址范围必须用短划线分隔,并且不包含任何空格。 如果指定 0.0.0.0,则允许从 Azure 中部署的任何资源进行公共访问来访问服务器。 将其设置为“None”会将服务器设置为公共访问模式,但不创建防火墙规则。 可接受的值为“Disabled”、“Enabled”、“All”、“None”、“{startIP}”和“{startIP}-{destinationIP}”,其中 startIP 和 destinationIP 范围为 0.0.0.0 到 255.255.255.255。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
计算 SKU 的名称。 遵循Standard_{VM 名称}的约定。 Examples: Standard_B1ms.
启用高可用性时备用服务器的可用性区域信息。
启用或禁用存储的自动增长。 默认值为“已启用”。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
服务器的存储容量。 最小值为 32 GiB,最大值为 16 TiB。
属性 | 值 |
---|---|
默认值: | 128 |
服务器的存储类型。 允许的值Premium_LRS和PremiumV2_LRS。 默认值为Premium_LRS。如果使用PremiumV2_LRS,则必须设置 iops 和吞吐量。
属性 | 值 |
---|---|
接受的值: | PremiumV2_LRS, Premium_LRS |
新的或现有的子网的名称或资源 ID。 如果要使用不同的资源组或订阅中的子网,请提供资源 ID 而不是名称。 请注意,子网将委派给 flexibleServers。 委派后,此子网不能用于任何其他类型的 Azure 资源。
以 CIDR 格式创建新子网时要使用的子网 IP 地址前缀。 默认值为 10.0.0.0/24。
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
服务器的存储吞吐量(MB/秒)。 仅当灵活服务器使用高级 SSD v2 磁盘时,才能更新此值。
服务器的计算层。 接受的值:可突发、GeneralPurpose、MemoryOptimized。
属性 | 值 |
---|---|
默认值: | GeneralPurpose |
服务器主版本。
属性 | 值 |
---|---|
默认值: | 17 |
新的或现有的虚拟网络的名称或 ID。 如果要使用来自不同资源组或订阅的 vnet,请提供资源 ID。 名称必须包含 2 到 64 个字符。 名称必须以字母或数字开头,以字母、数字或下划线结尾,并且只能包含字母、数字、下划线、句点或连字符。
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
要在其中预配资源的可用性区域。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server delete
删除灵活服务器。
az postgres flexible-server delete [--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
示例
删除灵活服务器。
az postgres flexible-server delete --resource-group testGroup --name testserver
在不提示或确认的情况下删除灵活服务器。
az postgres flexible-server delete --resource-group testGroup --name testserver --yes
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server execute
连接到灵活服务器。
az postgres flexible-server execute --admin-password
--admin-user
--name
[--database-name]
[--file-path]
[--querytext]
必需参数
管理员的登录密码。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
管理员的登录用户名。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
数据库的名称。
要执行的 sql 文件的路径。
要针对灵活服务器运行的查询。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server geo-restore
从备份中异地还原灵活服务器。
az postgres flexible-server geo-restore --location
--source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--restore-time]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
示例
将公共访问服务器“testerver”异地还原到具有公共访问权限的位置“newLocation”的新服务器“testserverNew”。
az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew --source-server testserver --location newLocation
将专用访问服务器“testerver”异地还原为具有新子网的新服务器“testserverNew”。 将为还原的服务器预配新的 vnet、子网和专用 DNS 区域。 有关更多专用访问方案,请参阅“灵活服务器创建”命令。
az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew \
--source-server testserver --vnet newVnet --subnet newSubnet \
--address-prefixes 172.0.0.0/16 --subnet-prefixes 172.0.0.0/24 \
--private-dns-zone testDNS.postgres.database.azure.com --location newLocation
将“testerver”异地还原到当前时间点,作为不同订阅/资源组中的新服务器“testserverNew”。 \ 此处 --resource-group 用于目标服务器的资源组,并且 --source-server 必须作为资源 ID 传递。 \ 此资源 ID 可以位于与用于 az account set 的订阅不同的订阅中。
az postgres flexible-server geo-restore --resource-group testGroup --name testserverNew --location newLocation \
--source-server /subscriptions/{sourceSubscriptionId}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
必需参数
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
要从中还原的源服务器的名称或资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
以 CIDR 格式创建新虚拟网络时要使用的 IP 地址前缀。 默认值为 10.0.0.0/16。
用于数据加密的异地备份用户标识的名称或资源 ID。 标识需要与备份区域位于同一区域。
用于数据加密的异地备份 keyvault 密钥的资源 ID。 密钥需要与备份区域位于同一区域。
是否启用异地冗余备份。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
用于数据加密的用户分配的标识的名称或资源 ID。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
用于数据加密的主密钥库密钥的资源 ID。
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
此参数仅适用于具有专用访问权限的服务器。 新的或现有的专用 DNS 区域的名称或 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 如果要使用不同资源组或订阅中的区域,请提供资源 ID。CLI 会在与虚拟网络相同的资源组中创建新的专用 DNS 区域(如果未由用户提供)。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
要从 UTC 还原的时间点(ISO8601格式),例如 2017-04-26T02:10:00+00:00 默认值设置为当前时间。
属性 | 值 |
---|---|
默认值: | 2025-07-14T11:13:18+00:00 |
新的或现有的子网的名称或资源 ID。 如果要使用不同的资源组或订阅中的子网,请提供资源 ID 而不是名称。 请注意,子网将委派给 flexibleServers。 委派后,此子网不能用于任何其他类型的 Azure 资源。
以 CIDR 格式创建新子网时要使用的子网 IP 地址前缀。 默认值为 10.0.0.0/24。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
新的或现有的虚拟网络的名称或 ID。 如果要使用来自不同资源组或订阅的 vnet,请提供资源 ID。 名称必须包含 2 到 64 个字符。 名称必须以字母或数字开头,以字母、数字或下划线结尾,并且只能包含字母、数字、下划线、句点或连字符。
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
要在其中预配资源的可用性区域。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server list
列出可用的灵活服务器。
az postgres flexible-server list [--resource-group]
[--show-cluster]
示例
列出订阅中的所有 PostgreSQL 灵活服务器。
az postgres flexible-server list
列出资源组中的所有 PostgreSQL 灵活服务器。
az postgres flexible-server list --resource-group testGroup
以表格式列出资源组中的所有 PostgreSQL 灵活服务器。
az postgres flexible-server list --resource-group testGroup --output table
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
仅显示弹性群集。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server list-skus
列出给定区域中的可用 SKU。
az postgres flexible-server list-skus --location
必需参数
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server restart
重启灵活服务器。
az postgres flexible-server restart [--failover]
[--ids]
[--name]
[--resource-group]
[--subscription]
示例
重启灵活服务器。
az postgres flexible-server restart --resource-group testGroup --name testserver
重启具有计划内故障转移的服务器
az postgres flexible-server restart --resource-group testGroup --name testserver --failover Planned
使用强制故障转移重启服务器
az postgres flexible-server restart --resource-group testGroup --name testserver --failover Forced
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
服务器重启作的强制或计划内故障转移。 允许的值:强制、计划。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server restore
从备份还原灵活服务器。
az postgres flexible-server restore --source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--restore-time]
[--storage-type {PremiumV2_LRS}]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
示例
将“testerver”还原到特定的时间点,作为新的服务器“testserverNew”。
az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --restore-time "2017-06-15T13:10:00Z"
将“testserver”还原到当前时间点,作为新的服务器“testserverNew”。
az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver
将“testerver”还原到当前时间点,作为不同资源组中的新服务器“testserverNew”。 \ 此处 --resource-group 用于目标服务器的资源组,并且 --source-server 必须作为资源 ID 传递。
az postgres flexible-server restore --resource-group testGroup --name testserverNew \
--source-server /subscriptions/{testSubscription}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
将“testerver”还原到当前时间点,作为不同订阅中的新服务器“testserverNew”。 \ 此处 --resource-group 用于目标服务器的资源组,并且 --source-server 必须作为资源 ID 传递。 \ 此资源 ID 可以位于与用于 az account set 的订阅不同的订阅中。
az postgres flexible-server restore --resource-group testGroup --name testserverNew \
--source-server /subscriptions/{sourceSubscriptionId}/resourceGroups/{sourceResourceGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{sourceServerName}
使用高级 SSD v2 磁盘将存储类型设置为“PremiumV2_LRS”,将“testerverver”还原到当前时间点作为新服务器“testerverNew”
az postgres flexible-server restore --resource-group testGroup --name testserverNew --source-server testserver --storage-type PremiumV2_LRS
必需参数
要从中还原的源服务器的名称或资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
以 CIDR 格式创建新虚拟网络时要使用的 IP 地址前缀。 默认值为 10.0.0.0/16。
用于数据加密的异地备份用户标识的名称或资源 ID。 标识需要与备份区域位于同一区域。
用于数据加密的异地备份 keyvault 密钥的资源 ID。 密钥需要与备份区域位于同一区域。
是否启用异地冗余备份。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
用于数据加密的用户分配的标识的名称或资源 ID。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
用于数据加密的主密钥库密钥的资源 ID。
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
此参数仅适用于具有专用访问权限的服务器。 新的或现有的专用 DNS 区域的名称或 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 如果要使用不同资源组或订阅中的区域,请提供资源 ID。CLI 会在与虚拟网络相同的资源组中创建新的专用 DNS 区域(如果未由用户提供)。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
要从 UTC 还原的时间点(ISO8601格式),例如 2017-04-26T02:10:00+00:00 默认值设置为当前时间。
属性 | 值 |
---|---|
默认值: | 2025-07-14T11:13:18+00:00 |
新服务器的存储类型。 允许的值PremiumV2_LRS。 默认值为 none。
属性 | 值 |
---|---|
接受的值: | PremiumV2_LRS |
新的或现有的子网的名称或资源 ID。 如果要使用不同的资源组或订阅中的子网,请提供资源 ID 而不是名称。 请注意,子网将委派给 flexibleServers。 委派后,此子网不能用于任何其他类型的 Azure 资源。
以 CIDR 格式创建新子网时要使用的子网 IP 地址前缀。 默认值为 10.0.0.0/24。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
新的或现有的虚拟网络的名称或 ID。 如果要使用来自不同资源组或订阅的 vnet,请提供资源 ID。 名称必须包含 2 到 64 个字符。 名称必须以字母或数字开头,以字母、数字或下划线结尾,并且只能包含字母、数字、下划线、句点或连字符。
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
要在其中预配资源的可用性区域。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server revive-dropped
从备份中恢复已删除的灵活服务器。
az postgres flexible-server revive-dropped --location
--source-server
[--address-prefixes]
[--backup-identity]
[--backup-key]
[--geo-redundant-backup {Disabled, Enabled}]
[--identity]
[--ids]
[--key]
[--name]
[--no-wait]
[--private-dns-zone]
[--resource-group]
[--subnet]
[--subnet-prefixes]
[--subscription]
[--vnet]
[--yes]
[--zone]
示例
恢复公共访问服务器“testerver”到具有公共访问权限的“newLocation”位置的新服务器“testserverNew”。
az postgres flexible-server revive-dropped --resource-group testGroup --name testserverNew --source-server /subscriptions/{SubId}/resourceGroups/{testGroup}/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver --location newLocation
恢复删除的公共访问服务器“testserver”,数据加密已启用数据加密,作为具有数据加密的新服务器“testserverNew”。
az postgres flexible-server revive-dropped -l testLocation --resource-group testGroup --name testserverNew \
--source-server testserver --key newKeyIdentifier --identity newIdentity
必需参数
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
要从中还原的源服务器的名称或资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
以 CIDR 格式创建新虚拟网络时要使用的 IP 地址前缀。 默认值为 10.0.0.0/16。
用于数据加密的异地备份用户标识的名称或资源 ID。 标识需要与备份区域位于同一区域。
用于数据加密的异地备份 keyvault 密钥的资源 ID。 密钥需要与备份区域位于同一区域。
是否启用异地冗余备份。
属性 | 值 |
---|---|
默认值: | Disabled |
接受的值: | Disabled, Enabled |
用于数据加密的用户分配的标识的名称或资源 ID。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
用于数据加密的主密钥库密钥的资源 ID。
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
此参数仅适用于具有专用访问权限的服务器。 新的或现有的专用 DNS 区域的名称或 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 如果要使用不同资源组或订阅中的区域,请提供资源 ID。CLI 会在与虚拟网络相同的资源组中创建新的专用 DNS 区域(如果未由用户提供)。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
新的或现有的子网的名称或资源 ID。 如果要使用不同的资源组或订阅中的子网,请提供资源 ID 而不是名称。 请注意,子网将委派给 flexibleServers。 委派后,此子网不能用于任何其他类型的 Azure 资源。
以 CIDR 格式创建新子网时要使用的子网 IP 地址前缀。 默认值为 10.0.0.0/24。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
新的或现有的虚拟网络的名称或 ID。 如果要使用来自不同资源组或订阅的 vnet,请提供资源 ID。 名称必须包含 2 到 64 个字符。 名称必须以字母或数字开头,以字母、数字或下划线结尾,并且只能包含字母、数字、下划线、句点或连字符。
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
要在其中预配资源的可用性区域。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server show
获取灵活服务器的详细信息。
az postgres flexible-server show [--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取灵活服务器的详细信息
az postgres flexible-server show --resource-group testGroup --name testserver
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server show-connection-string
显示 PostgreSQL 灵活服务器数据库的连接字符串。
az postgres flexible-server show-connection-string [--admin-password]
[--admin-user]
[--database-name]
[--ids]
[--pg-bouncer]
[--server-name]
[--subscription]
示例
显示 cmd 和编程语言的连接字符串。
az postgres flexible-server show-connection-string -s testserver -u username -p password -d databasename
显示启用了 PgBouncer 的 cmd 和编程语言的连接字符串。
az postgres flexible-server show-connection-string -s testserver -u username -p password -d databasename --pg-bouncer
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
管理员的密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下类别中的三个类别的字符:英文大写字母、英文小写字母、数字和非字母数字字符。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
默认值: | {password} |
服务器的管理员用户名。 设置后,无法更改它。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
默认值: | {login} |
数据库的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
默认值: | {database} |
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
显示 PgBouncer 的连接字符串。
属性 | 值 |
---|---|
默认值: | False |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
默认值: | {server} |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server start
启动灵活服务器。
az postgres flexible-server start [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
示例
启动灵活服务器。
az postgres flexible-server start --resource-group testGroup --name testserver
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server stop
停止灵活服务器。
az postgres flexible-server stop [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
示例
停止灵活服务器。
az postgres flexible-server stop --resource-group testGroup --name testserver
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server update
更新灵活服务器。
az postgres flexible-server update [--add]
[--admin-password]
[--backup-identity]
[--backup-key]
[--backup-retention]
[--force-string]
[--high-availability {Disabled, SameZone, ZoneRedundant}]
[--identity]
[--ids]
[--iops]
[--key]
[--maintenance-window]
[--microsoft-entra-auth {Disabled, Enabled}]
[--name]
[--node-count]
[--password-auth {Disabled, Enabled}]
[--performance-tier]
[--private-dns-zone]
[--public-access {Disabled, Enabled}]
[--remove]
[--resource-group]
[--set]
[--sku-name]
[--standby-zone]
[--storage-auto-grow {Disabled, Enabled}]
[--storage-size]
[--subscription]
[--tags]
[--throughput]
[--tier]
[--yes]
示例
使用服务器和资源组的本地上下文更新灵活服务器的 SKU。
az postgres flexible-server update --sku-name Standard_D4s_v3
更新服务器的标记。
az postgres flexible-server update --resource-group testGroup --name testserver --tags "k1=v1" "k2=v2"
Reset password
az postgres flexible-server update --resource-group testGroup --name testserver -p password123
更新灵活服务器,为已启用密码身份验证的服务器启用 Microsoft Entra 身份验证
az postgres flexible-server update --resource-group testGroup --name testserver --microsoft-entra-auth Enabled
更改数据加密的密钥/标识。 无法在创建服务器后启用数据加密,这只会更新密钥/标识。
# get key identifier of the existing key
newKeyIdentifier=$(az keyvault key show --vault-name testVault --name testKey \
--query key.kid -o tsv)
# update server with new key/identity
az postgres flexible-server update --resource-group testGroup --name testserver \
--key $newKeyIdentifier --identity newIdentity
更新灵活服务器以使用同一资源组和订阅中的专用 DNS 区域更新已启用 VNET 的服务器专用 DNS 区域。 如果尚未链接,将创建专用 DNS 区域, 专用 DNS 区域将链接到 VNET。
az postgres flexible-server update --resource-group testGroup --name testserver --private-dns-zone testDNS2.postgres.database.azure.com
更新灵活服务器以使用不同资源组和订阅中的专用 DNS 区域更新已启用 VNET 的服务器专用 DNS 区域。 如果尚未链接,专用 DNS 区域将链接到 VNET。
az postgres flexible-server update --resource-group testGroup --name testserver --private-dns-zone /subscriptions/{SubId2}/resourceGroups/{testGroup2}/providers/Microsoft.Network/privateDnsZones/testDNS.postgres.database.azure.com
更新灵活服务器的存储以启用/禁用存储自动增长。
az postgres flexible-server update --resource-group testGroup --name testserver --storage-auto-grow Enabled
更新灵活服务器的存储以设置自定义存储性能层。
az postgres flexible-server update --resource-group testGroup --name testserver --performance-tier P15
更新灵活服务器的存储以设置 IOPS(作/秒)。 服务器必须使用高级 SSD v2 磁盘。
az postgres flexible-server update --resource-group testGroup --name testserver --iops 3000
更新灵活服务器的存储以设置吞吐量(MB/秒)。 服务器必须使用高级 SSD v2 磁盘。
az postgres flexible-server update --resource-group testGroup --name testserver --throughput 125
通过纵向扩展节点计数来更新灵活服务器的群集大小。 必须是弹性群集。
az postgres flexible-server update --resource-group testGroup --name testcluster --node-count 6
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
管理员的密码。 最少 8 个字符,最多 128 个字符。 密码必须包含以下类别中的三个类别的字符:英文大写字母、英文小写字母、数字和非字母数字字符。
属性 | 值 |
---|---|
Parameter group: | Authentication Arguments |
用于数据加密的异地备份用户标识的名称或资源 ID。 标识需要与备份区域位于同一区域。
用于数据加密的异地备份 keyvault 密钥的资源 ID。 密钥需要与备份区域位于同一区域。
备份保留的天数。 范围为 7 到 35 天。 默认值为 7 天。
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | False |
启用(ZoneRedundant 或 SameZone)或禁用高可用性功能。
属性 | 值 |
---|---|
接受的值: | Disabled, SameZone, ZoneRedundant |
用于数据加密的用户分配的标识的名称或资源 ID。
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
要为此服务器分配的 IOPS(作/秒)的值。 仅当灵活服务器使用高级 SSD v2 磁盘时,才能更新此值。
用于数据加密的主密钥库密钥的资源 ID。
为维护指定的时间段(UTC)。 示例:“Sun:23:30”计划于星期天晚上 11:30 UTC。 若要重新设置为默认传入“Disabled”。
是否启用Microsoft Entra 身份验证。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
弹性群集的节点数。 范围为 1 到 10。
是否启用密码身份验证。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
服务器的性能层。
此参数仅适用于具有专用访问权限的服务器。 新的或现有的专用 DNS 区域的名称或 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 如果要使用不同资源组或订阅中的区域,请提供资源 ID。CLI 会在与虚拟网络相同的资源组中创建新的专用 DNS 区域(如果未由用户提供)。
启用或禁用服务器上的公共访问。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
计算 SKU 的名称。 遵循Standard_{VM 名称}的约定。 Examples: Standard_B1ms.
启用高可用性时备用服务器的可用性区域信息。
启用或禁用存储的自动增长。 默认值为“已启用”。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
服务器的存储容量。 最小值为 32 GiB,最大值为 16 TiB。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
服务器的存储吞吐量(MB/秒)。 仅当灵活服务器使用高级 SSD v2 磁盘时,才能更新此值。
服务器的计算层。 接受的值:可突发、GeneralPurpose、MemoryOptimized。
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server upgrade
升级灵活服务器的主要版本。
az postgres flexible-server upgrade --version {13, 14, 15, 16, 17}
[--ids]
[--name]
[--resource-group]
[--subscription]
[--yes]
示例
将服务器“testsvr”升级到 PostgreSQL 主要版本 17。
az postgres flexible-server upgrade -g testgroup -n testsvr -v 17
必需参数
服务器主版本。
属性 | 值 |
---|---|
接受的值: | 13, 14, 15, 16, 17 |
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不要提示确认。
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server wait
等待灵活服务器满足某些条件。
az postgres flexible-server wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
等待在“Succeeded”中使用“provisioningState”创建。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
等到删除为止。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
等待资源存在。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
轮询间隔(以秒为单位)。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | 30 |
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
最大等待(以秒为单位)。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | 3600 |
等到 provisioningState 更新为“Succeeded”。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
全局参数
增加日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
只显示错误,取消显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关详细信息和示例,请参阅 http://jmespath.org/ 。
增加日志记录详细程度。 对完整调试日志使用 --debug。
属性 | 值 |
---|---|
默认值: | False |