기존 서버를 업데이트합니다. 요청 본문에는 일반 서버 정의에 있는 속성 중 하나 또는 여러 개가 포함될 수 있습니다.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2025-08-01
URI 매개 변수
| Name |
In(다음 안에) |
필수 |
형식 |
Description |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
리소스 그룹의 이름입니다. 이름은 대소문자를 구분하지 않습니다.
|
|
serverName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*
|
서버의 이름입니다.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
대상 구독의 ID입니다. 값은 UUID여야 합니다.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
이 작업에 사용할 API 버전입니다.
|
요청 본문
| Name |
형식 |
Description |
|
identity
|
UserAssignedIdentity
|
애플리케이션의 ID를 설명합니다.
|
|
properties.administratorLogin
|
string
|
PostgreSQL 인스턴스에 할당된 첫 번째 암호 기반 관리자로 지정된 로그인의 이름입니다. 서버에서 암호 기반 인증을 처음 활성화할 때 지정해야 합니다. 한 번 지정된 값으로 설정하면 서버의 남은 수명 동안 변경할 수 없습니다. 암호 기반 인증을 사용하도록 설정된 서버에서 암호 기반 인증을 사용하지 않도록 설정하면 이 암호 기반 역할이 삭제되지 않습니다.
|
|
properties.administratorLoginPassword
|
string
(password)
|
관리자 로그인에 할당된 암호입니다. 암호 인증이 활성화되어 있는 한 이 암호는 언제든지 변경할 수 있습니다.
|
|
properties.authConfig
|
AuthConfigForPatch
|
서버의 인증 구성 속성입니다.
|
|
properties.availabilityZone
|
string
|
서버의 가용성 영역입니다.
|
|
properties.backup
|
BackupForPatch
|
서버의 백업 속성입니다.
|
|
properties.cluster
|
Cluster
|
서버의 클러스터 속성입니다.
|
|
properties.createMode
|
CreateModeForPatch
|
기존 서버의 업데이트 모드입니다.
|
|
properties.dataEncryption
|
DataEncryption
|
서버의 데이터 암호화 속성입니다.
|
|
properties.highAvailability
|
HighAvailabilityForPatch
|
서버의 고가용성 속성입니다.
|
|
properties.maintenanceWindow
|
MaintenanceWindowForPatch
|
서버의 유지 관리 기간 속성입니다.
|
|
properties.network
|
Network
|
서버의 네트워크 속성입니다. 고객이 제공한 가상 네트워크에 서버를 통합하려는 경우에만 필요합니다.
|
|
properties.replica
|
Replica
|
서버의 읽기 전용 복제본 속성입니다. 서버를 승격하려는 경우에만 필요합니다.
|
|
properties.replicationRole
|
ReplicationRole
|
복제 세트에서 서버의 역할입니다.
|
|
properties.storage
|
Storage
|
서버의 스토리지 속성입니다.
|
|
properties.version
|
PostgresMajorVersion
|
PostgreSQL 데이터베이스 엔진의 주 버전입니다.
|
|
sku
|
SkuForPatch
|
서버의 컴퓨팅 계층 및 크기입니다.
|
|
tags
|
object
|
키-값 쌍 형태의 애플리케이션별 메타데이터입니다.
|
응답
| Name |
형식 |
Description |
|
202 Accepted
|
|
Accepted.
헤더
- Location: string
- Azure-AsyncOperation: string
|
|
Other Status Codes
|
ErrorResponse
|
작업이 실패한 이유를 설명하는 오류 응답입니다.
|
보안
azure_auth
Microsoft Entra OAuth2 흐름
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
| Name |
Description |
|
user_impersonation
|
사용자 계정 가장
|
예제
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"replica": {
"promoteMode": "Standalone",
"promoteOption": "Forced"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersPromoteReplicaAsForcedStandaloneServer.json
*/
/**
* Sample code: Promote a read replica to a standalone server with forced data synchronization. Meaning that it
* doesn't wait for data in the read replica to be synchronized with its source server before it initiates the
* promotion to a standalone server.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
promoteAReadReplicaToAStandaloneServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.STANDALONE)
.withPromoteOption(ReadReplicaPromoteOption.FORCED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_promote_replica_as_forced_standalone_server.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={"properties": {"replica": {"promoteMode": "Standalone", "promoteOption": "Forced"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedStandaloneServer.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedStandaloneServer.json
*/
async function promoteAReadReplicaToAStandaloneServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
replica: { promoteMode: "Standalone", promoteOption: "Forced" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"replica": {
"promoteMode": "Standalone",
"promoteOption": "Planned"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersPromoteReplicaAsPlannedStandaloneServer.json
*/
/**
* Sample code: Promote a read replica to a standalone server with planned data synchronization. Meaning that it
* waits for data in the read replica to be fully synchronized with its source server before it initiates the
* promotion to a standalone server.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
promoteAReadReplicaToAStandaloneServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.STANDALONE)
.withPromoteOption(ReadReplicaPromoteOption.PLANNED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_promote_replica_as_planned_standalone_server.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={"properties": {"replica": {"promoteMode": "Standalone", "promoteOption": "Planned"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedStandaloneServer.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedStandaloneServer.json
*/
async function promoteAReadReplicaToAStandaloneServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesThePromotionToAStandaloneServer() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
replica: { promoteMode: "Standalone", promoteOption: "Planned" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Switch over a read replica to primary server with forced data synchronization. Meaning that it doesn't wait for data in the read replica to be synchronized with its source server before it initiates the switching of roles between the read replica and the primary server.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"replica": {
"promoteMode": "Switchover",
"promoteOption": "Forced"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersPromoteReplicaAsForcedSwitchover.json
*/
/**
* Sample code: Switch over a read replica to primary server with forced data synchronization. Meaning that it
* doesn't wait for data in the read replica to be synchronized with its source server before it initiates the
* switching of roles between the read replica and the primary server.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
switchOverAReadReplicaToPrimaryServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER)
.withPromoteOption(ReadReplicaPromoteOption.FORCED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_promote_replica_as_forced_switchover.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={"properties": {"replica": {"promoteMode": "Switchover", "promoteOption": "Forced"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedSwitchover.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsForcedSwitchover.json
*/
async function switchOverAReadReplicaToPrimaryServerWithForcedDataSynchronizationMeaningThatItDoesnTWaitForDataInTheReadReplicaToBeSynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
replica: { promoteMode: "Switchover", promoteOption: "Forced" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Switch over a read replica to primary server with planned data synchronization. Meaning that it waits for data in the read replica to be fully synchronized with its source server before it initiates the switching of roles between the read replica and the primary server.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"replica": {
"promoteMode": "Switchover",
"promoteOption": "Planned"
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteMode;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ReadReplicaPromoteOption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replica;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersPromoteReplicaAsPlannedSwitchover.json
*/
/**
* Sample code: Switch over a read replica to primary server with planned data synchronization. Meaning that it
* waits for data in the read replica to be fully synchronized with its source server before it initiates the
* switching of roles between the read replica and the primary server.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
switchOverAReadReplicaToPrimaryServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withReplica(new Replica().withPromoteMode(ReadReplicaPromoteMode.SWITCHOVER)
.withPromoteOption(ReadReplicaPromoteOption.PLANNED)).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_promote_replica_as_planned_switchover.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={"properties": {"replica": {"promoteMode": "Switchover", "promoteOption": "Planned"}}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedSwitchover.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersPromoteReplicaAsPlannedSwitchover.json
*/
async function switchOverAReadReplicaToPrimaryServerWithPlannedDataSynchronizationMeaningThatItWaitsForDataInTheReadReplicaToBeFullySynchronizedWithItsSourceServerBeforeItInitiatesTheSwitchingOfRolesBetweenTheReadReplicaAndThePrimaryServer() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
replica: { promoteMode: "Switchover", promoteOption: "Planned" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server to upgrade the major version of PostgreSQL database engine.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"createMode": "Update",
"version": "17"
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.PostgresMajorVersion;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersUpdateWithMajorVersionUpgrade.json
*/
/**
* Sample code: Update an existing server to upgrade the major version of PostgreSQL database engine.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void updateAnExistingServerToUpgradeTheMajorVersionOfPostgreSQLDatabaseEngine(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withVersion(PostgresMajorVersion.ONE_SEVEN).withCreateMode(CreateModeForPatch.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update_with_major_version_upgrade.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={"properties": {"createMode": "Update", "version": "17"}},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMajorVersionUpgrade.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMajorVersionUpgrade.json
*/
async function updateAnExistingServerToUpgradeTheMajorVersionOfPostgreSqlDatabaseEngine() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = { createMode: "Update", version: "17" };
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server with custom maintenance window.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"properties": {
"createMode": "Update",
"maintenanceWindow": {
"customWindow": "Enabled",
"dayOfWeek": 0,
"startHour": 8,
"startMinute": 0
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.MaintenanceWindowForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersUpdateWithCustomMaintenanceWindow.json
*/
/**
* Sample code: Update an existing server with custom maintenance window.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void updateAnExistingServerWithCustomMaintenanceWindow(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withMaintenanceWindow(new MaintenanceWindowForPatch().withCustomWindow("Enabled")
.withStartHour(8).withStartMinute(0).withDayOfWeek(0)).withCreateMode(CreateModeForPatch.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update_with_custom_maintenance_window.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={
"properties": {
"createMode": "Update",
"maintenanceWindow": {"customWindow": "Enabled", "dayOfWeek": 0, "startHour": 8, "startMinute": 0},
}
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithCustomMaintenanceWindow.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithCustomMaintenanceWindow.json
*/
async function updateAnExistingServerWithCustomMaintenanceWindow() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
createMode: "Update",
maintenanceWindow: {
customWindow: "Enabled",
dayOfWeek: 0,
startHour: 8,
startMinute: 0,
},
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server with data encryption based on customer managed key with automatic key version update.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}
},
"type": "UserAssigned"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"dataEncryption": {
"type": "AzureKeyVault",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryptionType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersUpdateWithDataEncryptionEnabledAutoUpdate.json
*/
/**
* Sample code: Update an existing server with data encryption based on customer managed key with automatic key
* version update.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withSku(new SkuForPatch().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
new UserIdentity(),
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
new UserIdentity())).withType(IdentityType.USER_ASSIGNED))
.withAdministratorLoginPassword("examplenewpassword")
.withBackup(new BackupForPatch().withBackupRetentionDays(20))
.withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder")
.withPrimaryUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity")
.withGeoBackupKeyUri("fakeTokenPlaceholder")
.withGeoBackupUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity")
.withType(DataEncryptionType.AZURE_KEY_VAULT))
.withCreateMode(CreateModeForPatch.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update_with_data_encryption_enabled_auto_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {},
},
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"dataEncryption": {
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"type": "AzureKeyVault",
},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabledAutoUpdate.json
*/
async function updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKeyWithAutomaticKeyVersionUpdate() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
administratorLoginPassword: "examplenewpassword",
backup: { backupRetentionDays: 20 },
createMode: "Update",
dataEncryption: {
type: "AzureKeyVault",
geoBackupKeyURI: "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey",
geoBackupUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
primaryKeyURI: "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey",
primaryUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/exampleresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplegeoredundantidentity":
{},
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/exampleresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/exampleprimaryidentity":
{},
},
},
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server with data encryption based on customer managed key.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"identity": {
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {}
},
"type": "UserAssigned"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"dataEncryption": {
"type": "AzureKeyVault",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryption;
import com.azure.resourcemanager.postgresqlflexibleserver.models.DataEncryptionType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.IdentityType;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserAssignedIdentity;
import com.azure.resourcemanager.postgresqlflexibleserver.models.UserIdentity;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersUpdateWithDataEncryptionEnabled.json
*/
/**
* Sample code: Update an existing server with data encryption based on customer managed key.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withSku(new SkuForPatch().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withIdentity(new UserAssignedIdentity().withUserAssignedIdentities(mapOf(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
new UserIdentity(),
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
new UserIdentity())).withType(IdentityType.USER_ASSIGNED))
.withAdministratorLoginPassword("examplenewpassword")
.withBackup(new BackupForPatch().withBackupRetentionDays(20))
.withDataEncryption(new DataEncryption().withPrimaryKeyUri("fakeTokenPlaceholder")
.withPrimaryUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity")
.withGeoBackupKeyUri("fakeTokenPlaceholder")
.withGeoBackupUserAssignedIdentityId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity")
.withType(DataEncryptionType.AZURE_KEY_VAULT))
.withCreateMode(CreateModeForPatch.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update_with_data_encryption_enabled.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity": {},
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity": {},
},
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"dataEncryption": {
"geoBackupKeyURI": "https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
"geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
"primaryKeyURI": "https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
"type": "AzureKeyVault",
},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabled.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithDataEncryptionEnabled.json
*/
async function updateAnExistingServerWithDataEncryptionBasedOnCustomerManagedKey() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
administratorLoginPassword: "examplenewpassword",
backup: { backupRetentionDays: 20 },
createMode: "Update",
dataEncryption: {
type: "AzureKeyVault",
geoBackupKeyURI:
"https://examplegeoredundantkeyvault.vault.azure.net/keys/examplekey/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
geoBackupUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplegeoredundantidentity",
primaryKeyURI:
"https://exampleprimarykeyvault.vault.azure.net/keys/examplekey/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
primaryUserAssignedIdentityId:
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/exampleprimaryidentity",
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/exampleresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplegeoredundantidentity":
{},
"/subscriptions/ffffffffFfffFfffFfffFfffffffffff/resourceGroups/exampleresourcegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/exampleprimaryidentity":
{},
},
},
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server with Microsoft Entra authentication enabled.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"authConfig": {
"activeDirectoryAuth": "Enabled",
"passwordAuth": "Enabled",
"tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt"
},
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Disabled",
"tier": "P30"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.AuthConfigForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.MicrosoftEntraAuth;
import com.azure.resourcemanager.postgresqlflexibleserver.models.PasswordBasedAuth;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage;
import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* ServersUpdateWithMicrosoftEntraEnabled.json
*/
/**
* Sample code: Update an existing server with Microsoft Entra authentication enabled.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void updateAnExistingServerWithMicrosoftEntraAuthenticationEnabled(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withSku(new SkuForPatch().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withAdministratorLoginPassword("examplenewpassword")
.withStorage(new Storage().withStorageSizeGB(1024).withAutoGrow(StorageAutoGrow.DISABLED)
.withTier(AzureManagedDiskPerformanceTier.P30))
.withBackup(new BackupForPatch().withBackupRetentionDays(20))
.withAuthConfig(new AuthConfigForPatch().withActiveDirectoryAuth(MicrosoftEntraAuth.ENABLED)
.withPasswordAuth(PasswordBasedAuth.ENABLED).withTenantId("tttttt-tttt-tttt-tttt-tttttttttttt"))
.withCreateMode(CreateModeForPatch.UPDATE).apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update_with_microsoft_entra_enabled.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={
"properties": {
"administratorLoginPassword": "examplenewpassword",
"authConfig": {
"activeDirectoryAuth": "Enabled",
"passwordAuth": "Enabled",
"tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt",
},
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"storage": {"autoGrow": "Disabled", "storageSizeGB": 1024, "tier": "P30"},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMicrosoftEntraEnabled.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdateWithMicrosoftEntraEnabled.json
*/
async function updateAnExistingServerWithMicrosoftEntraAuthenticationEnabled() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
administratorLoginPassword: "examplenewpassword",
authConfig: {
activeDirectoryAuth: "Enabled",
passwordAuth: "Enabled",
tenantId: "tttttt-tttt-tttt-tttt-tttttttttttt",
},
backup: { backupRetentionDays: 20 },
createMode: "Update",
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
storage: { autoGrow: "Disabled", storageSizeGB: 1024, tier: "P30" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Update an existing server.
샘플 요청
PATCH https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver?api-version=2025-08-01
{
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D8s_v3"
},
"properties": {
"administratorLoginPassword": "examplenewpassword",
"createMode": "Update",
"storage": {
"storageSizeGB": 1024,
"autoGrow": "Enabled",
"tier": "P30"
},
"backup": {
"backupRetentionDays": 20
}
}
}
import com.azure.resourcemanager.postgresqlflexibleserver.models.AzureManagedDiskPerformanceTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.CreateModeForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Server;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuForPatch;
import com.azure.resourcemanager.postgresqlflexibleserver.models.SkuTier;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Storage;
import com.azure.resourcemanager.postgresqlflexibleserver.models.StorageAutoGrow;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for Servers Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdate.json
*/
/**
* Sample code: Update an existing server.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
updateAnExistingServer(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
Server resource = manager.servers()
.getByResourceGroupWithResponse("exampleresourcegroup", "exampleserver", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withSku(new SkuForPatch().withName("Standard_D8s_v3").withTier(SkuTier.GENERAL_PURPOSE))
.withAdministratorLoginPassword("examplenewpassword")
.withStorage(new Storage().withStorageSizeGB(1024).withAutoGrow(StorageAutoGrow.ENABLED)
.withTier(AzureManagedDiskPerformanceTier.P30))
.withBackup(new BackupForPatch().withBackupRetentionDays(20)).withCreateMode(CreateModeForPatch.UPDATE)
.apply();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python servers_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.servers.begin_update(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
parameters={
"properties": {
"administratorLoginPassword": "examplenewpassword",
"backup": {"backupRetentionDays": 20},
"createMode": "Update",
"storage": {"autoGrow": "Enabled", "storageSizeGB": 1024, "tier": "P30"},
},
"sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"},
},
).result()
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
*
* @summary Updates an existing server. The request body can contain one or multiple of the properties present in the normal server definition.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/ServersUpdate.json
*/
async function updateAnExistingServer() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const parameters = {
administratorLoginPassword: "examplenewpassword",
backup: { backupRetentionDays: 20 },
createMode: "Update",
sku: { name: "Standard_D8s_v3", tier: "GeneralPurpose" },
storage: { autoGrow: "Enabled", storageSizeGB: 1024, tier: "P30" },
};
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.servers.beginUpdateAndWait(resourceGroupName, serverName, parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
샘플 응답
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
정의
AuthConfigForPatch
Object
서버의 인증 구성 속성입니다.
| Name |
형식 |
Description |
|
activeDirectoryAuth
|
MicrosoftEntraAuth
|
서버가 Microsoft Entra 인증을 지원하는지 여부를 나타냅니다.
|
|
passwordAuth
|
PasswordBasedAuth
|
서버가 암호 기반 인증을 지원하는지 여부를 나타냅니다.
|
|
tenantId
|
string
|
위임된 리소스의 테넌트 식별자입니다.
|
열거형
서버의 스토리지 계층입니다.
| 값 |
Description |
|
P1
|
최소 IOPS를 위한 엔트리 레벨 SSD로 가벼운 개발 또는 테스트 워크로드에 이상적입니다.
|
|
P2
|
일관되게 짧은 대기 시간이 필요한 소규모 애플리케이션의 경우 IOPS가 약간 더 높습니다.
|
|
P3
|
중간 처리량으로 기본 프로덕션 워크로드에 대한 균형 잡힌 성능.
|
|
P4
|
예측 가능한 성능 요구 사항이 있는 성장하는 애플리케이션을 위한 향상된 IOPS.
|
|
P6
|
안정적인 처리량과 대기 시간이 필요한 안정적인 워크로드를 위한 미드 티어 SSD입니다.
|
|
P10
|
확장 가능한 성능을 갖춘 범용 프로덕션 워크로드에 널리 사용됩니다.
|
|
P15
|
읽기/쓰기 작업이 빈번한 까다로운 앱을 위한 높은 IOPS 계층입니다.
|
|
P20
|
소규모 I/O 집약적 워크로드에 적합한 고성능 SSD(솔리드 스테이트 디스크)의 진입점입니다.
|
|
P30
|
중간 처리량 및 대기 시간에 민감한 애플리케이션을 위한 균형 잡힌 계층입니다.
|
|
P40
|
일관된 IOPS 요구로 증가하는 프로덕션 워크로드를 위한 향상된 성능.
|
|
P50
|
지속적인 높은 처리량이 필요한 엔터프라이즈급 애플리케이션에 최적화되어 있습니다.
|
|
P60
|
IOPS가 높아진 대규모 데이터베이스 및 분석 워크로드를 위한 대용량 계층입니다.
|
|
P70
|
매우 짧은 대기 시간과 높은 동시성이 필요한 미션 크리티컬 시스템을 위해 설계되었습니다.
|
|
P80
|
최대 IOPS 및 처리량을 위한 최상위 계층 SSD는 가장 까다로운 워크로드에 이상적입니다.
|
BackupForPatch
Object
서버의 백업 속성입니다.
| Name |
형식 |
Description |
|
backupRetentionDays
|
integer
(int32)
|
서버의 백업 보존 기간(일)입니다.
|
|
earliestRestoreDate
|
string
(date-time)
|
서버의 가장 빠른 복원 지점 시간(ISO8601 형식)입니다.
|
|
geoRedundantBackup
|
GeographicallyRedundantBackup
|
서버가 지리적으로 중복된 백업을 만들도록 구성되어 있는지 여부를 나타냅니다.
|
Cluster
Object
서버의 클러스터 속성입니다.
| Name |
형식 |
Default value |
Description |
|
clusterSize
|
integer
(int32)
|
0
|
탄력적 클러스터에 할당된 노드의 수입니다.
|
|
defaultDatabaseName
|
string
|
|
탄력적 클러스터의 기본 데이터베이스 이름입니다.
|
CreateModeForPatch
열거형
기존 서버의 업데이트 모드입니다.
| 값 |
Description |
|
Default
|
'업데이트'와 동일합니다.
|
|
Update
|
조작이 기존 서버를 업데이트합니다.
|
DataEncryption
Object
서버의 데이터 암호화 속성입니다.
| Name |
형식 |
Description |
|
geoBackupEncryptionKeyStatus
|
EncryptionKeyStatus
|
지리적으로 중복된 백업을 지원하도록 구성된 경우 서버와 연결된 지리적으로 중복된 스토리지를 암호화하기 위해 고객 관리형 키를 기반으로 데이터 암호화로 구성된 서버에서 사용하는 키의 상태입니다.
|
|
geoBackupKeyURI
|
string
|
지리적으로 중복된 백업을 지원하도록 구성된 서버에 연결된 지리적으로 중복된 스토리지의 데이터 암호화를 위해 Azure Key Vault의 키에 액세스하는 데 사용되는 사용자 할당 관리 ID의 식별자입니다.
|
|
geoBackupUserAssignedIdentityId
|
string
|
지리적으로 중복된 백업을 지원하도록 구성된 서버에 연결된 지리적으로 중복된 스토리지의 데이터 암호화를 위해 Azure Key Vault의 키에 액세스하는 데 사용되는 사용자 할당 관리 ID의 식별자입니다.
|
|
primaryEncryptionKeyStatus
|
EncryptionKeyStatus
|
고객관리형 키를 기반으로 데이터 암호화로 구성된 서버에서 서버와 연결된 주 스토리지를 암호화하는 데 사용하는 키의 상태입니다.
|
|
primaryKeyURI
|
string
|
서버에 연결된 주 스토리지의 데이터 암호화에 사용되는 Azure Key Vault의 키 URI입니다.
|
|
primaryUserAssignedIdentityId
|
string
|
서버에 연결된 주 스토리지의 데이터 암호화를 위해 Azure Key Vault의 키에 액세스하는 데 사용되는 사용자 할당 관리 ID의 식별자입니다.
|
|
type
|
DataEncryptionType
|
서버에서 사용하는 데이터 암호화 유형입니다.
|
DataEncryptionType
열거형
서버에서 사용하는 데이터 암호화 유형입니다.
| 값 |
Description |
|
SystemManaged
|
단순성과 규정 준수를 위해 플랫폼 관리형 키를 사용하여 Azure에서 관리하는 암호화입니다.
|
|
AzureKeyVault
|
향상된 제어 및 보안을 위해 Azure Key Vault에 저장된 고객 관리형 키를 사용하여 암호화합니다.
|
EncryptionKeyStatus
열거형
고객관리형 키를 기반으로 데이터 암호화로 구성된 서버에서 서버와 연결된 주 스토리지를 암호화하는 데 사용하는 키의 상태입니다.
| 값 |
Description |
|
Valid
|
키는 유효하며 암호화에 사용할 수 있습니다.
|
|
Invalid
|
키가 유효하지 않으며 암호화에 사용할 수 없습니다. 가능한 원인으로는 키 삭제, 권한 변경, 키 사용 안 함, 키 유형이 지원되지 않음 또는 현재 날짜가 키와 연결된 유효 기간을 벗어났습니다.
|
ErrorAdditionalInfo
Object
리소스 관리 오류 추가 정보입니다.
| Name |
형식 |
Description |
|
info
|
object
|
추가 정보입니다.
|
|
type
|
string
|
추가 정보 유형입니다.
|
ErrorDetail
Object
오류 세부 정보입니다.
| Name |
형식 |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
오류 추가 정보입니다.
|
|
code
|
string
|
오류 코드입니다.
|
|
details
|
ErrorDetail[]
|
오류 세부 정보입니다.
|
|
message
|
string
|
오류 메시지입니다.
|
|
target
|
string
|
오류 대상입니다.
|
ErrorResponse
Object
오류 응답
GeographicallyRedundantBackup
열거형
서버가 지리적으로 중복된 백업을 만들도록 구성되어 있는지 여부를 나타냅니다.
| 값 |
Description |
|
Enabled
|
서버는 지리적으로 중복된 백업을 생성하도록 구성됩니다.
|
|
Disabled
|
서버가 지리적으로 중복된 백업을 생성하도록 구성되지 않았습니다.
|
HighAvailabilityForPatch
Object
서버의 고가용성 속성입니다.
| Name |
형식 |
Description |
|
mode
|
HighAvailabilityMode
|
서버에 대한 고가용성 모드입니다.
|
|
standbyAvailabilityZone
|
string
|
고가용성이 SameZone 또는 ZoneRedundant로 설정될 때 생성되는 대기 서버와 연결된 가용성 영역입니다.
|
|
state
|
HighAvailabilityState
|
고가용성이 SameZone 또는 ZoneRedundant로 설정될 때 생성되는 대기 서버의 가능한 상태입니다.
|
HighAvailabilityMode
열거형
서버에 대한 고가용성 모드입니다.
| 값 |
Description |
|
Disabled
|
서버에 대해 고가용성이 사용 안함으로 설정되었습니다.
|
|
ZoneRedundant
|
서버에 대해 고가용성이 활성화되며, 대기 서버는 기본 서버와 다른 가용성 영역에 있습니다.
|
|
SameZone
|
서버에 대해 고가용성이 활성화되며, 대기 서버는 기본과 동일한 가용성 영역에 있습니다.
|
HighAvailabilityState
열거형
고가용성이 SameZone 또는 ZoneRedundant로 설정될 때 생성되는 대기 서버의 가능한 상태입니다.
| 값 |
Description |
|
NotEnabled
|
서버에 대해 고가용성을 사용할 수 없습니다.
|
|
CreatingStandby
|
대기 서버가 생성되고 있습니다.
|
|
ReplicatingData
|
데이터가 대기 서버에 복제되고 있습니다.
|
|
FailingOver
|
대기 서버에 대한 장애 복구 작업이 진행 중입니다.
|
|
Healthy
|
대기 서버가 정상이며 장애 조치(failover) 시 인계할 준비가 되어 있습니다.
|
|
RemovingStandby
|
대기 서버가 제거되고 있습니다.
|
IdentityType
열거형
서버와 연결된 ID 유형입니다.
| 값 |
Description |
|
None
|
서버에 관리 ID가 할당되지 않습니다.
|
|
UserAssigned
|
사용자가 제공한 하나 이상의 관리 ID가 서버에 할당됩니다.
|
|
SystemAssigned
|
Azure는 서버의 수명 주기와 연결된 ID를 자동으로 만들고 관리합니다.
|
|
SystemAssigned,UserAssigned
|
시스템 할당 ID와 사용자 할당 ID가 모두 서버에 할당됩니다.
|
MaintenanceWindowForPatch
Object
서버의 유지 관리 기간 속성입니다.
| Name |
형식 |
Description |
|
customWindow
|
string
|
사용자 지정 창이 활성화되었는지 여부를 나타냅니다.
|
|
dayOfWeek
|
integer
(int32)
|
유지 관리 창에 사용할 요일입니다.
|
|
startHour
|
integer
(int32)
|
유지 관리 창에 사용할 시작 시간입니다.
|
|
startMinute
|
integer
(int32)
|
유지 관리 창에 사용할 시작 시간(분)입니다.
|
MicrosoftEntraAuth
열거형
서버가 Microsoft Entra 인증을 지원하는지 여부를 나타냅니다.
| 값 |
Description |
|
Enabled
|
서버는 Microsoft Entra 인증을 지원합니다.
|
|
Disabled
|
서버는 Microsoft Entra 인증을 지원하지 않습니다.
|
Network
Object
서버의 네트워크 속성입니다.
| Name |
형식 |
Description |
|
delegatedSubnetResourceId
|
string
|
위임된 서브넷의 리소스 식별자입니다. 서버를 사용자 고유의 가상 네트워크에 통합하려는 경우 새 서버를 만드는 동안 필요합니다. 업데이트 작업의 경우 프라이빗 DNS 영역에 할당된 값을 변경하려는 경우에만 이 속성을 제공해야 합니다.
|
|
privateDnsZoneArmResourceId
|
string
|
프라이빗 DNS 영역의 식별자입니다. 서버를 사용자 고유의 가상 네트워크에 통합하려는 경우 새 서버를 만드는 동안 필요합니다. 업데이트 작업의 경우 프라이빗 DNS 영역에 할당된 값을 변경하려는 경우에만 이 속성을 제공해야 합니다.
|
|
publicNetworkAccess
|
ServerPublicNetworkAccessState
|
공용 네트워크 액세스를 사용할 수 있는지 여부를 나타냅니다. 이는 서버가 배포될 때 고객이 소유하고 제공하는 가상 네트워크에 통합되지 않은 서버에만 지원됩니다.
|
PasswordBasedAuth
열거형
서버가 암호 기반 인증을 지원하는지 여부를 나타냅니다.
| 값 |
Description |
|
Enabled
|
서버는 암호 기반 인증을 지원합니다.
|
|
Disabled
|
서버는 암호 기반 인증을 지원하지 않습니다.
|
PostgresMajorVersion
열거형
PostgreSQL 데이터베이스 엔진의 주 버전입니다.
| 값 |
Description |
|
18
|
PostgreSQL 18.
|
|
17
|
PostgreSQL 17.
|
|
16
|
PostgreSQL 16.
|
|
15
|
PostgreSQL 15.
|
|
14
|
PostgreSQL 14.
|
|
13
|
PostgreSQL 13.
|
|
12
|
PostgreSQL 12.
|
|
11
|
PostgreSQL 11.
|
열거형
읽기 전용 복제본에 적용할 작업 유형입니다. 이 속성은 쓰기 전용입니다. 독립 실행형은 읽기 전용 복제본이 독립 실행형 서버로 승격되고 복제 세트에서 완전히 독립적인 엔터티가 됨을 의미합니다. 전환은 읽기 복제본이 주 서버와 함께 역할을 수행함을 의미합니다.
| 값 |
Description |
|
Standalone
|
읽기 전용 복제본은 독립 서버가 됩니다.
|
|
Switchover
|
읽기 전용 복제본은 기본 서버와 역할을 교환합니다.
|
열거형
promoteMode 속성에 지정된 작업을 처리할 때 사용할 데이터 동기화 옵션입니다. 이 속성은 쓰기 전용입니다.
| 값 |
Description |
|
Planned
|
이 작업은 작업을 시작하기 전에 읽기 전용 복제본의 데이터가 원본 서버와 완전히 동기화될 때까지 기다립니다.
|
|
Forced
|
이 작업은 작업을 시작하기 전에 읽기 전용 복제본의 데이터가 원본 서버와 동기화될 때까지 기다리지 않습니다.
|
Replica
Object
서버의 복제본 속성입니다.
| Name |
형식 |
Description |
|
capacity
|
integer
(int32)
|
서버에 허용되는 최대 읽기 전용 복제본 수입니다.
|
|
promoteMode
|
ReadReplicaPromoteMode
|
읽기 전용 복제본에 적용할 작업 유형입니다. 이 속성은 쓰기 전용입니다. 독립 실행형은 읽기 전용 복제본이 독립 실행형 서버로 승격되고 복제 세트에서 완전히 독립적인 엔터티가 됨을 의미합니다. 전환은 읽기 복제본이 주 서버와 함께 역할을 수행함을 의미합니다.
|
|
promoteOption
|
ReadReplicaPromoteOption
|
promoteMode 속성에 지정된 작업을 처리할 때 사용할 데이터 동기화 옵션입니다. 이 속성은 쓰기 전용입니다.
|
|
replicationState
|
ReplicationState
|
읽기 전용 복제본의 복제 상태를 나타냅니다. 이 속성은 대상 서버가 읽기 전용 복제본인 경우에만 반환됩니다. 가능한 값은 Active, Broken, Catchup, Provisioning, Reconfiguring 및 Updating입니다
|
|
role
|
ReplicationRole
|
복제 세트에서 서버의 역할입니다.
|
ReplicationRole
열거형
복제 세트에서 서버의 역할입니다.
| 값 |
Description |
|
None
|
할당된 복제 역할이 없습니다. 서버는 독립적으로 작동합니다.
|
|
Primary
|
하나 이상의 복제본에 복제하기 위한 소스 서버 역할을 합니다.
|
|
AsyncReplica
|
동일한 지역 내의 주 서버에서 비동기적으로 데이터를 수신합니다.
|
|
GeoAsyncReplica
|
지리적 중복성을 위해 다른 지역의 주 서버에서 비동기적으로 데이터를 수신합니다.
|
ReplicationState
열거형
읽기 전용 복제본의 복제 상태를 나타냅니다. 이 속성은 대상 서버가 읽기 전용 복제본인 경우에만 반환됩니다. 가능한 값은 Active, Broken, Catchup, Provisioning, Reconfiguring 및 Updating입니다
| 값 |
Description |
|
Active
|
읽기 전용 복제본은 완전히 동기화되고 주 서버에서 데이터를 적극적으로 복제합니다.
|
|
Catchup
|
읽기 전용 복제본은 주 서버 뒤에 있으며 현재 보류 중인 변경 사항을 따라잡고 있습니다.
|
|
Provisioning
|
읽기 전용 복제본이 생성되고 초기화 중입니다.
|
|
Updating
|
읽기 전용 복제본에 몇 가지 변경 사항이 적용되고 있으며, 기본 서버로 승격하는 컴퓨팅 크기를 변경할 수 있습니다.
|
|
Broken
|
복제가 실패했거나 중단되었습니다.
|
|
Reconfiguring
|
원본 또는 설정의 변경으로 인해 읽기 전용 복제본이 재구성되고 있습니다.
|
ServerForPatch
Object
업데이트할 서버를 나타냅니다.
| Name |
형식 |
Description |
|
identity
|
UserAssignedIdentity
|
애플리케이션의 ID를 설명합니다.
|
|
properties.administratorLogin
|
string
|
PostgreSQL 인스턴스에 할당된 첫 번째 암호 기반 관리자로 지정된 로그인의 이름입니다. 서버에서 암호 기반 인증을 처음 활성화할 때 지정해야 합니다. 한 번 지정된 값으로 설정하면 서버의 남은 수명 동안 변경할 수 없습니다. 암호 기반 인증을 사용하도록 설정된 서버에서 암호 기반 인증을 사용하지 않도록 설정하면 이 암호 기반 역할이 삭제되지 않습니다.
|
|
properties.administratorLoginPassword
|
string
(password)
|
관리자 로그인에 할당된 암호입니다. 암호 인증이 활성화되어 있는 한 이 암호는 언제든지 변경할 수 있습니다.
|
|
properties.authConfig
|
AuthConfigForPatch
|
서버의 인증 구성 속성입니다.
|
|
properties.availabilityZone
|
string
|
서버의 가용성 영역입니다.
|
|
properties.backup
|
BackupForPatch
|
서버의 백업 속성입니다.
|
|
properties.cluster
|
Cluster
|
서버의 클러스터 속성입니다.
|
|
properties.createMode
|
CreateModeForPatch
|
기존 서버의 업데이트 모드입니다.
|
|
properties.dataEncryption
|
DataEncryption
|
서버의 데이터 암호화 속성입니다.
|
|
properties.highAvailability
|
HighAvailabilityForPatch
|
서버의 고가용성 속성입니다.
|
|
properties.maintenanceWindow
|
MaintenanceWindowForPatch
|
서버의 유지 관리 기간 속성입니다.
|
|
properties.network
|
Network
|
서버의 네트워크 속성입니다. 고객이 제공한 가상 네트워크에 서버를 통합하려는 경우에만 필요합니다.
|
|
properties.replica
|
Replica
|
서버의 읽기 전용 복제본 속성입니다. 서버를 승격하려는 경우에만 필요합니다.
|
|
properties.replicationRole
|
ReplicationRole
|
복제 세트에서 서버의 역할입니다.
|
|
properties.storage
|
Storage
|
서버의 스토리지 속성입니다.
|
|
properties.version
|
PostgresMajorVersion
|
PostgreSQL 데이터베이스 엔진의 주 버전입니다.
|
|
sku
|
SkuForPatch
|
서버의 컴퓨팅 계층 및 크기입니다.
|
|
tags
|
object
|
키-값 쌍 형태의 애플리케이션별 메타데이터입니다.
|
ServerPublicNetworkAccessState
열거형
공용 네트워크 액세스를 사용할 수 있는지 여부를 나타냅니다. 이는 서버가 배포될 때 고객이 소유하고 제공하는 가상 네트워크에 통합되지 않은 서버에만 지원됩니다.
| 값 |
Description |
|
Enabled
|
공용 네트워크 액세스가 활성화되었습니다. 이렇게 하면 연결 클라이언트에서 발생하는 들어오는 트래픽을 허용하는 필수 방화벽 규칙이 있는 경우 공용 인터넷에서 서버에 액세스할 수 있습니다. 이는 프라이빗 엔드포인트를 사용하여 이 서버에 연결하는 것과 호환됩니다.
|
|
Disabled
|
공용 네트워크 액세스가 사용하지 않도록 설정되어 있습니다. 즉, 공용 인터넷에서 서버에 액세스할 수 없으며 프라이빗 엔드포인트를 통해서만 액세스할 수 있습니다.
|
SkuForPatch
Object
서버의 컴퓨팅 정보.
| Name |
형식 |
Description |
|
name
|
string
|
서버에 할당된 지정된 컴퓨팅 크기를 알 수 있는 이름입니다.
|
|
tier
|
SkuTier
|
서버에 할당된 컴퓨팅의 계층입니다.
|
SkuTier
열거형
서버에 할당된 컴퓨팅의 계층입니다.
| 값 |
Description |
|
Burstable
|
CPU 사용량이 드물게 하는 비용 효율적인 계층으로, 성능 요구 사항이 낮은 개발 및 테스트 워크로드에 이상적입니다.
|
|
GeneralPurpose
|
대부분의 워크로드에 대해 컴퓨팅과 메모리가 균형 잡혀 확장 가능한 성능과 I/O 처리량을 제공합니다.
|
|
MemoryOptimized
|
빠른 인메모리 처리와 높은 동시성이 필요한 까다로운 워크로드를 위한 높은 메모리 대 코어 비율.
|
Storage
Object
서버의 스토리지 속성입니다.
| Name |
형식 |
Description |
|
autoGrow
|
StorageAutoGrow
|
사용 가능한 공간이 0에 가깝고 조건에 따라 스토리지 크기가 자동으로 증가할 수 있는 경우 서버의 스토리지 크기의 자동 증가를 사용하거나 사용하지 않도록 설정하는 플래그입니다.
|
|
iops
|
integer
(int32)
|
스토리지에 지원되는 최대 IOPS입니다. 스토리지 유형이 PremiumV2_LRS 또는 UltraSSD_LRS인 경우 필요합니다.
|
|
storageSizeGB
|
integer
(int32)
|
서버에 할당된 스토리지의 크기입니다.
|
|
throughput
|
integer
(int32)
|
스토리지에 지원되는 최대 처리량입니다. 스토리지 유형이 PremiumV2_LRS 또는 UltraSSD_LRS인 경우 필요합니다.
|
|
tier
|
AzureManagedDiskPerformanceTier
|
서버의 스토리지 계층입니다.
|
|
type
|
StorageType
|
서버에 할당된 스토리지 유형입니다. 허용되는 값은 Premium_LRS, PremiumV2_LRS 또는 UltraSSD_LRS입니다. 지정하지 않으면 기본값은 Premium_LRS입니다.
|
StorageAutoGrow
열거형
사용 가능한 공간이 0에 가깝고 조건에 따라 스토리지 크기가 자동으로 증가할 수 있는 경우 서버의 스토리지 크기의 자동 증가를 사용하거나 사용하지 않도록 설정하는 플래그입니다.
| 값 |
Description |
|
Enabled
|
서버는 사용 가능한 공간이 0에 가깝고 조건에서 스토리지 크기를 자동으로 늘릴 수 있는 경우 스토리지 크기를 자동으로 늘려야 합니다.
|
|
Disabled
|
사용 가능한 공간이 0에 가까울 때 서버는 스토리지 크기를 자동으로 늘리지 않아야 합니다.
|
StorageType
열거형
서버에 할당된 스토리지 유형입니다. 허용되는 값은 Premium_LRS, PremiumV2_LRS 또는 UltraSSD_LRS입니다. 지정하지 않으면 기본값은 Premium_LRS입니다.
| 값 |
Description |
|
Premium_LRS
|
표준 SSD(Solid State Disk) 지원 스토리지는 범용 워크로드에 일관된 성능을 제공합니다.
|
|
PremiumV2_LRS
|
까다로운 엔터프라이즈 워크로드를 위한 확장성과 성능이 향상된 차세대 솔리드 스테이트 디스크(SSD) 스토리지입니다.
|
|
UltraSSD_LRS
|
극한의 IOPS 및 대기 시간에 민감한 애플리케이션을 위해 설계된 하이엔드 솔리드 스테이트 디스크(SSD) 스토리지입니다.
|
UserAssignedIdentity
Object
서버와 연결된 ID입니다.
| Name |
형식 |
Description |
|
principalId
|
string
|
사용자 할당 관리 ID에 연결된 서비스 주체의 개체 식별자입니다.
|
|
tenantId
|
string
|
서버 테넌트의 식별자입니다.
|
|
type
|
IdentityType
|
서버와 연결된 ID 유형입니다.
|
|
userAssignedIdentities
|
<string,
UserIdentity>
|
사용자가 할당한 관리 ID의 매핑입니다.
|
UserIdentity
Object
서버와 연결된 사용자 할당 관리 ID입니다.
| Name |
형식 |
Description |
|
clientId
|
string
|
사용자 할당 관리 ID에 연결된 서비스 주체의 클라이언트 식별자입니다.
|
|
principalId
|
string
|
사용자 할당 관리 ID에 연결된 서비스 주체의 개체 식별자입니다.
|