Meglévő kiszolgáló frissítése. A kérelem törzse tartalmazhat egy vagy több tulajdonságot a normál kiszolgálódefinícióban.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}?api-version=2025-08-01
URI-paraméterek
| Name |
In |
Kötelező |
Típus |
Description |
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Az erőforráscsoport neve. A név nem megkülönbözteti a kis- és nagybetűket.
|
|
serverName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*
|
A kiszolgáló neve.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
A cél-előfizetés azonosítója. Az értéknek UUID-nek kell lennie.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
A művelethez használandó API-verzió.
|
Kérelem törzse
| Name |
Típus |
Description |
|
identity
|
UserAssignedIdentity
|
Az alkalmazás identitását ismerteti.
|
|
properties.administratorLogin
|
string
|
A PostgreSQL-példányhoz rendelt első jelszóalapú rendszergazdaként kijelölt bejelentkezési név neve. Meg kell adni, amikor először engedélyezi a jelszóalapú hitelesítést egy kiszolgálón. Ha egy adott értékre van állítva, az a szerver élettartamának hátralévő részében nem módosítható. Ha letiltja a jelszóalapú hitelesítést egy olyan kiszolgálón, amelyen engedélyezve volt, ez a jelszóalapú szerepkör nem törlődik.
|
|
properties.administratorLoginPassword
|
string
(password)
|
A rendszergazdai bejelentkezéshez rendelt jelszó. Amíg a jelszó-hitelesítés engedélyezve van, ez a jelszó bármikor módosítható.
|
|
properties.authConfig
|
AuthConfigForPatch
|
Kiszolgáló hitelesítési konfigurációs tulajdonságai.
|
|
properties.availabilityZone
|
string
|
Kiszolgáló rendelkezésre állási zónája.
|
|
properties.backup
|
BackupForPatch
|
Kiszolgáló biztonsági mentési tulajdonságai.
|
|
properties.cluster
|
Cluster
|
Egy kiszolgáló fürttulajdonságai.
|
|
properties.createMode
|
CreateModeForPatch
|
Meglévő kiszolgáló frissítési módja.
|
|
properties.dataEncryption
|
DataEncryption
|
A kiszolgáló adattitkosítási tulajdonságai.
|
|
properties.highAvailability
|
HighAvailabilityForPatch
|
A kiszolgáló magas rendelkezésre állási tulajdonságai.
|
|
properties.maintenanceWindow
|
MaintenanceWindowForPatch
|
A kiszolgáló karbantartási időszakának tulajdonságai.
|
|
properties.network
|
Network
|
A kiszolgáló hálózati tulajdonságai. Csak akkor szükséges, ha azt szeretné, hogy a kiszolgáló integrálva legyen az ügyfél által biztosított virtuális hálózatba.
|
|
properties.replica
|
Replica
|
Kiszolgáló replikatulajdonságainak olvasása. Csak abban az esetben szükséges, ha elő szeretne léptetni egy szervert.
|
|
properties.replicationRole
|
ReplicationRole
|
A kiszolgáló szerepe egy replikációs készletben.
|
|
properties.storage
|
Storage
|
A kiszolgáló tárolási tulajdonságai.
|
|
properties.version
|
PostgresMajorVersion
|
A PostgreSQL adatbázismotor főverziója.
|
|
sku
|
SkuForPatch
|
Kiszolgáló számítási szintje és mérete.
|
|
tags
|
object
|
Alkalmazásspecifikus metaadatok kulcs-érték párok formájában.
|
Válaszok
| Name |
Típus |
Description |
|
202 Accepted
|
|
Accepted.
Fejlécek
- Location: string
- Azure-AsyncOperation: string
|
|
Other Status Codes
|
ErrorResponse
|
Hibaválasz, amely leírja, hogy miért nem sikerült a művelet.
|
Biztonság
azure_auth
Microsoft Entra OAuth2 Flow
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
| Name |
Description |
|
user_impersonation
|
a felhasználói fiók megszemélyesítése
|
Példák
Mintakérelem
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
Mintaválasz
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
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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.
Mintakérelem
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
Mintaválasz
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
Definíciók
| Name |
Description |
|
AuthConfigForPatch
|
Kiszolgáló hitelesítési konfigurációs tulajdonságai.
|
|
AzureManagedDiskPerformanceTier
|
Kiszolgáló tárolási szintje.
|
|
BackupForPatch
|
Kiszolgáló biztonsági mentési tulajdonságai.
|
|
Cluster
|
Egy kiszolgáló fürttulajdonságai.
|
|
CreateModeForPatch
|
Meglévő kiszolgáló frissítési módja.
|
|
DataEncryption
|
A kiszolgáló adattitkosítási tulajdonságai.
|
|
DataEncryptionType
|
A kiszolgáló által használt adattitkosítási típus.
|
|
EncryptionKeyStatus
|
Az ügyfél által felügyelt kulcson alapuló adattitkosítással konfigurált kiszolgáló által a kiszolgálóhoz társított elsődleges tároló titkosításához használt kulcs állapota.
|
|
ErrorAdditionalInfo
|
Az erőforrás-kezelési hiba további információi.
|
|
ErrorDetail
|
A hiba részletei.
|
|
ErrorResponse
|
Hibaválasz
|
|
GeographicallyRedundantBackup
|
Azt jelzi, hogy a kiszolgáló földrajzilag redundáns biztonsági másolatok létrehozására van-e konfigurálva.
|
|
HighAvailabilityForPatch
|
A kiszolgáló magas rendelkezésre állási tulajdonságai.
|
|
HighAvailabilityMode
|
Kiszolgáló magas rendelkezésre állási módja.
|
|
HighAvailabilityState
|
A készenléti kiszolgáló lehetséges állapotai, amelyek akkor jönnek létre, ha a magas rendelkezésre állás SameZone vagy ZoneRedundant értékre van állítva.
|
|
IdentityType
|
A kiszolgálóhoz társított identitások típusai.
|
|
MaintenanceWindowForPatch
|
A kiszolgáló karbantartási időszakának tulajdonságai.
|
|
MicrosoftEntraAuth
|
Azt jelzi, hogy a kiszolgáló támogatja-e a Microsoft Entra hitelesítést.
|
|
Network
|
A kiszolgáló hálózati tulajdonságai.
|
|
PasswordBasedAuth
|
Azt jelzi, hogy a kiszolgáló támogatja-e a jelszóalapú hitelesítést.
|
|
PostgresMajorVersion
|
A PostgreSQL adatbázismotor főverziója.
|
|
ReadReplicaPromoteMode
|
Az olvasási replikára alkalmazandó művelet típusa. Ez a tulajdonság csak írható. Az önálló azt jelenti, hogy az olvasási replika önálló kiszolgálóvá lesz előlépve, és teljesen független entitássá válik a replikációs készlettől. Az átváltás azt jelenti, hogy az olvasási replika az elsődleges kiszolgálóval fog szerepköröket kapni.
|
|
ReadReplicaPromoteOption
|
A promoteMode tulajdonságban megadott művelet feldolgozásakor használható adatszinkronizálási beállítás. Ez a tulajdonság csak írható.
|
|
Replica
|
Kiszolgáló replikatulajdonságai.
|
|
ReplicationRole
|
A kiszolgáló szerepe egy replikációs készletben.
|
|
ReplicationState
|
Az olvasási replika replikációs állapotát jelzi. Ezt a tulajdonságot a rendszer csak akkor adja vissza, ha a célkiszolgáló olvasási replika. A lehetséges értékek a következők: Aktív, Törött, Felzárkózás, Kiépítés, Újrakonfigurálás és Frissítés
|
|
ServerForPatch
|
A frissíteni kívánt kiszolgálót jelöli.
|
|
ServerPublicNetworkAccessState
|
Azt jelzi, hogy a nyilvános hálózati hozzáférés engedélyezve van-e vagy sem. Ez csak olyan kiszolgálók esetében támogatott, amelyek nincsenek integrálva olyan virtuális hálózatba, amelyet az ügyfél birtokol és biztosít a kiszolgáló telepítésekor.
|
|
SkuForPatch
|
Kiszolgáló számítási adatai.
|
|
SkuTier
|
A kiszolgálóhoz rendelt számítási szint.
|
|
Storage
|
A kiszolgáló tárolási tulajdonságai.
|
|
StorageAutoGrow
|
Jelölő, amely engedélyezi vagy letiltja a kiszolgáló tárterületének automatikus növekedését, ha a rendelkezésre álló terület nullához közeledik, és a feltételek lehetővé teszik a tárterület méretének automatikus növelését.
|
|
StorageType
|
A kiszolgálóhoz rendelt tároló típusa. Az engedélyezett értékek a következők: Premium_LRS, PremiumV2_LRS vagy UltraSSD_LRS. Ha nincs megadva, alapértelmezés szerint Premium_LRS.
|
|
UserAssignedIdentity
|
Kiszolgálóhoz társított identitások.
|
|
UserIdentity
|
Felhasználó által hozzárendelt felügyelt identitás egy kiszolgálóhoz társítva.
|
AuthConfigForPatch
Tárgy
Kiszolgáló hitelesítési konfigurációs tulajdonságai.
| Name |
Típus |
Description |
|
activeDirectoryAuth
|
MicrosoftEntraAuth
|
Azt jelzi, hogy a kiszolgáló támogatja-e a Microsoft Entra hitelesítést.
|
|
passwordAuth
|
PasswordBasedAuth
|
Azt jelzi, hogy a kiszolgáló támogatja-e a jelszóalapú hitelesítést.
|
|
tenantId
|
string
|
A delegált erőforrás bérlőjének azonosítója.
|
Felsorolás
Kiszolgáló tárolási szintje.
| Érték |
Description |
|
P1
|
Belépő szintű SSD a minimális IOPS-ért, ideális könnyű fejlesztési vagy tesztelési feladatokhoz.
|
|
P2
|
Valamivel magasabb IOPS a konzisztens alacsony késést igénylő kis léptékű alkalmazásokhoz.
|
|
P3
|
Kiegyensúlyozott teljesítmény az alapszintű éles számítási feladatokhoz, mérsékelt átviteli sebességgel.
|
|
P4
|
Továbbfejlesztett IOPS a kiszámítható teljesítményigényű alkalmazások bővítéséhez.
|
|
P6
|
Középkategóriás SSD megbízható átviteli sebességet és késést igénylő állandó számítási feladatokhoz.
|
|
P10
|
Népszerű választás általános célú éles számítási feladatokhoz, skálázható teljesítménnyel.
|
|
P15
|
Magas IOPS-szint a gyakori olvasási/írási műveletekkel rendelkező, igényes alkalmazásokhoz.
|
|
P20
|
Belépési pont a nagy teljesítményű SSD-khez, amelyek kis léptékű I/O-igényes számítási feladatokhoz alkalmasak.
|
|
P30
|
Kiegyensúlyozott szint mérsékelt átviteli sebességhez és késésérzékeny alkalmazásokhoz.
|
|
P40
|
Továbbfejlesztett teljesítmény a növekvő éles számítási feladatokhoz konzisztens IOPS-igényekkel.
|
|
P50
|
Nagyvállalati szintű alkalmazásokhoz optimalizálva, amelyek tartósan nagy átviteli sebességet igényelnek.
|
|
P60
|
Nagy kapacitású szint nagy adatbázisokhoz és elemzési számítási feladatokhoz emelt IOPS-értékkel.
|
|
P70
|
Rendkívül alacsony késleltetést és nagy egyidejűséget igénylő, kritikus fontosságú rendszerekhez tervezték.
|
|
P80
|
Csúcskategóriás SSD a maximális IOPS és átviteli sebesség érdekében, ideális a legnagyobb igénybevételt jelentő számítási feladatokhoz.
|
BackupForPatch
Tárgy
Kiszolgáló biztonsági mentési tulajdonságai.
| Name |
Típus |
Description |
|
backupRetentionDays
|
integer
(int32)
|
Biztonsági mentési megőrzési napok a kiszolgálón.
|
|
earliestRestoreDate
|
string
(date-time)
|
A kiszolgáló legkorábbi visszaállítási pontja (ISO8601 formátum).
|
|
geoRedundantBackup
|
GeographicallyRedundantBackup
|
Azt jelzi, hogy a kiszolgáló földrajzilag redundáns biztonsági másolatok létrehozására van-e konfigurálva.
|
Cluster
Tárgy
Egy kiszolgáló fürttulajdonságai.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
clusterSize
|
integer
(int32)
|
0
|
A rugalmas fürthöz rendelt csomópontok száma.
|
|
defaultDatabaseName
|
string
|
|
A rugalmas fürt alapértelmezett adatbázisneve.
|
CreateModeForPatch
Felsorolás
Meglévő kiszolgáló frissítési módja.
| Érték |
Description |
|
Default
|
Ez egyenértékű a "Frissítés" értékkel.
|
|
Update
|
A művelet frissít egy meglévő kiszolgálót.
|
DataEncryption
Tárgy
A kiszolgáló adattitkosítási tulajdonságai.
| Name |
Típus |
Description |
|
geoBackupEncryptionKeyStatus
|
EncryptionKeyStatus
|
Az ügyfél által felügyelt kulcson alapuló adattitkosítással konfigurált kiszolgáló által használt kulcs állapota a kiszolgálóhoz társított földrajzilag redundáns tároló titkosításához, ha az a földrajzilag redundáns biztonsági mentések támogatására van konfigurálva.
|
|
geoBackupKeyURI
|
string
|
A felhasználó által hozzárendelt felügyelt identitás azonosítója, amely a kulcs eléréséhez Azure Key Vault a földrajzilag redundáns biztonsági mentések támogatására konfigurált kiszolgálóhoz társított földrajzilag redundáns tároló adattitkosításához.
|
|
geoBackupUserAssignedIdentityId
|
string
|
A felhasználó által hozzárendelt felügyelt identitás azonosítója, amely a kulcs eléréséhez Azure Key Vault a földrajzilag redundáns biztonsági mentések támogatására konfigurált kiszolgálóhoz társított földrajzilag redundáns tároló adattitkosításához.
|
|
primaryEncryptionKeyStatus
|
EncryptionKeyStatus
|
Az ügyfél által felügyelt kulcson alapuló adattitkosítással konfigurált kiszolgáló által a kiszolgálóhoz társított elsődleges tároló titkosításához használt kulcs állapota.
|
|
primaryKeyURI
|
string
|
A kiszolgálóhoz társított elsődleges tároló adattitkosításához használt kulcs Azure Key Vault URI-ja.
|
|
primaryUserAssignedIdentityId
|
string
|
A felhasználó által hozzárendelt felügyelt identitás azonosítója, amely a kulcs eléréséhez Azure Key Vault a kiszolgálóhoz társított elsődleges tároló adattitkosításához.
|
|
type
|
DataEncryptionType
|
A kiszolgáló által használt adattitkosítási típus.
|
DataEncryptionType
Felsorolás
A kiszolgáló által használt adattitkosítási típus.
| Érték |
Description |
|
SystemManaged
|
Az Azure által kezelt titkosítás platform által felügyelt kulcsokkal az egyszerűség és a megfelelőség érdekében.
|
|
AzureKeyVault
|
Titkosítás az Azure Key Vaultban tárolt ügyfél által felügyelt kulcsokkal a fokozott vezérlés és biztonság érdekében.
|
EncryptionKeyStatus
Felsorolás
Az ügyfél által felügyelt kulcson alapuló adattitkosítással konfigurált kiszolgáló által a kiszolgálóhoz társított elsődleges tároló titkosításához használt kulcs állapota.
| Érték |
Description |
|
Valid
|
A kulcs érvényes és titkosításra használható.
|
|
Invalid
|
A kulcs érvénytelen, és nem használható titkosításra. A lehetséges okok közé tartozik a kulcs törlése, az engedély módosítása, a kulcs letiltása, a kulcstípus nem támogatott, vagy az aktuális dátum a kulcshoz társított érvényességi időszakon kívül esik.
|
ErrorAdditionalInfo
Tárgy
Az erőforrás-kezelési hiba további információi.
| Name |
Típus |
Description |
|
info
|
object
|
A további információk.
|
|
type
|
string
|
A további információtípus.
|
ErrorDetail
Tárgy
A hiba részletei.
| Name |
Típus |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
A hiba további információi.
|
|
code
|
string
|
A hibakód.
|
|
details
|
ErrorDetail[]
|
A hiba részletei.
|
|
message
|
string
|
A hibaüzenet.
|
|
target
|
string
|
A hibacél.
|
ErrorResponse
Tárgy
Hibaválasz
| Name |
Típus |
Description |
|
error
|
ErrorDetail
|
A hibaobjektum.
|
GeographicallyRedundantBackup
Felsorolás
Azt jelzi, hogy a kiszolgáló földrajzilag redundáns biztonsági másolatok létrehozására van-e konfigurálva.
| Érték |
Description |
|
Enabled
|
A kiszolgáló úgy van konfigurálva, hogy földrajzilag redundáns biztonsági másolatokat hozzon létre.
|
|
Disabled
|
A kiszolgáló nincs beállítva földrajzilag redundáns biztonsági másolatok létrehozására.
|
HighAvailabilityForPatch
Tárgy
A kiszolgáló magas rendelkezésre állási tulajdonságai.
| Name |
Típus |
Description |
|
mode
|
HighAvailabilityMode
|
Kiszolgáló magas rendelkezésre állási módja.
|
|
standbyAvailabilityZone
|
string
|
A készenléti kiszolgálóhoz társított rendelkezésre állási zóna, amely akkor jön létre, ha a magas rendelkezésre állás SameZone vagy ZoneRedundant értékre van állítva.
|
|
state
|
HighAvailabilityState
|
A készenléti kiszolgáló lehetséges állapotai, amelyek akkor jönnek létre, ha a magas rendelkezésre állás SameZone vagy ZoneRedundant értékre van állítva.
|
HighAvailabilityMode
Felsorolás
Kiszolgáló magas rendelkezésre állási módja.
| Érték |
Description |
|
Disabled
|
A magas rendelkezésre állás le van tiltva a kiszolgálón.
|
|
ZoneRedundant
|
A magas rendelkezésre állás engedélyezve van a kiszolgálón, a készenléti kiszolgáló az elsődlegestől eltérő rendelkezésre állási zónában található.
|
|
SameZone
|
A magas rendelkezésre állás engedélyezve van a kiszolgálón, a készenléti kiszolgáló ugyanabban a rendelkezésre állási zónában van, mint az elsődleges.
|
HighAvailabilityState
Felsorolás
A készenléti kiszolgáló lehetséges állapotai, amelyek akkor jönnek létre, ha a magas rendelkezésre állás SameZone vagy ZoneRedundant értékre van állítva.
| Érték |
Description |
|
NotEnabled
|
A magas rendelkezésre állás nincs engedélyezve a kiszolgálón.
|
|
CreatingStandby
|
Készenléti kiszolgáló létrehozása folyamatban van.
|
|
ReplicatingData
|
Az adatok replikálása folyamatban van a készenléti kiszolgálóra.
|
|
FailingOver
|
A készenléti kiszolgáló feladatátvételi művelete folyamatban van.
|
|
Healthy
|
A készenléti kiszolgáló kifogástalan állapotú, és feladatátvétel esetén készen áll az átvételre.
|
|
RemovingStandby
|
A készenléti kiszolgáló eltávolítása folyamatban van.
|
IdentityType
Felsorolás
A kiszolgálóhoz társított identitások típusai.
| Érték |
Description |
|
None
|
A kiszolgálóhoz nincs hozzárendelve felügyelt identitás.
|
|
UserAssigned
|
A felhasználó által biztosított egy vagy több felügyelt identitás hozzá van rendelve a kiszolgálóhoz.
|
|
SystemAssigned
|
Az Azure automatikusan létrehozza és kezeli a kiszolgáló életciklusához társított identitást.
|
|
SystemAssigned,UserAssigned
|
A rendszer által hozzárendelt és a felhasználó által hozzárendelt identitások is hozzá vannak rendelve a kiszolgálóhoz.
|
MaintenanceWindowForPatch
Tárgy
A kiszolgáló karbantartási időszakának tulajdonságai.
| Name |
Típus |
Description |
|
customWindow
|
string
|
Azt jelzi, hogy az egyéni ablak engedélyezve van-e vagy le van tiltva.
|
|
dayOfWeek
|
integer
(int32)
|
A karbantartási időszakhoz használandó hét napja.
|
|
startHour
|
integer
(int32)
|
A karbantartási időszakhoz használt kezdő óra.
|
|
startMinute
|
integer
(int32)
|
A karbantartási időszakhoz használt kezdő perc.
|
MicrosoftEntraAuth
Felsorolás
Azt jelzi, hogy a kiszolgáló támogatja-e a Microsoft Entra hitelesítést.
| Érték |
Description |
|
Enabled
|
A kiszolgáló támogatja a Microsoft Entra hitelesítést.
|
|
Disabled
|
A kiszolgáló nem támogatja a Microsoft Entra hitelesítést.
|
Network
Tárgy
A kiszolgáló hálózati tulajdonságai.
| Name |
Típus |
Description |
|
delegatedSubnetResourceId
|
string
|
A delegált alhálózat erőforrás-azonosítója. Új kiszolgáló létrehozásakor szükséges, ha azt szeretné, hogy a kiszolgáló integrálva legyen a saját virtuális hálózatába. Frissítési művelet esetén csak akkor kell megadnia ezt a tulajdonságot, ha módosítani szeretné a privát DNS-zónához rendelt értéket.
|
|
privateDnsZoneArmResourceId
|
string
|
A privát DNS-zóna azonosítója. Új kiszolgáló létrehozásakor szükséges, ha azt szeretné, hogy a kiszolgáló integrálva legyen a saját virtuális hálózatába. Frissítési művelet esetén csak akkor kell megadnia ezt a tulajdonságot, ha módosítani szeretné a privát DNS-zónához rendelt értéket.
|
|
publicNetworkAccess
|
ServerPublicNetworkAccessState
|
Azt jelzi, hogy a nyilvános hálózati hozzáférés engedélyezve van-e vagy sem. Ez csak olyan kiszolgálók esetében támogatott, amelyek nincsenek integrálva olyan virtuális hálózatba, amelyet az ügyfél birtokol és biztosít a kiszolgáló telepítésekor.
|
PasswordBasedAuth
Felsorolás
Azt jelzi, hogy a kiszolgáló támogatja-e a jelszóalapú hitelesítést.
| Érték |
Description |
|
Enabled
|
A szerver támogatja a jelszó alapú hitelesítést.
|
|
Disabled
|
A kiszolgáló nem támogatja a jelszóalapú hitelesítést.
|
PostgresMajorVersion
Felsorolás
A PostgreSQL adatbázismotor főverziója.
| Érték |
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.
|
Felsorolás
Az olvasási replikára alkalmazandó művelet típusa. Ez a tulajdonság csak írható. Az önálló azt jelenti, hogy az olvasási replika önálló kiszolgálóvá lesz előlépve, és teljesen független entitássá válik a replikációs készlettől. Az átváltás azt jelenti, hogy az olvasási replika az elsődleges kiszolgálóval fog szerepköröket kapni.
| Érték |
Description |
|
Standalone
|
Az olvasási replika független kiszolgálóvá válik.
|
|
Switchover
|
Az olvasási replika felcseréli a szerepköröket az elsődleges kiszolgálóval.
|
Felsorolás
A promoteMode tulajdonságban megadott művelet feldolgozásakor használható adatszinkronizálási beállítás. Ez a tulajdonság csak írható.
| Érték |
Description |
|
Planned
|
A művelet elindítása előtt megvárja, amíg az olvasási replikában lévő adatok teljesen szinkronizálva lesznek a forráskiszolgálóval.
|
|
Forced
|
A művelet nem várja meg, amíg az olvasási replikában lévő adatok szinkronizálódnak a forráskiszolgálóval, mielőtt elindítja a műveletet.
|
Replica
Tárgy
Kiszolgáló replikatulajdonságai.
| Name |
Típus |
Description |
|
capacity
|
integer
(int32)
|
A kiszolgáló számára engedélyezett olvasási replikák maximális száma.
|
|
promoteMode
|
ReadReplicaPromoteMode
|
Az olvasási replikára alkalmazandó művelet típusa. Ez a tulajdonság csak írható. Az önálló azt jelenti, hogy az olvasási replika önálló kiszolgálóvá lesz előlépve, és teljesen független entitássá válik a replikációs készlettől. Az átváltás azt jelenti, hogy az olvasási replika az elsődleges kiszolgálóval fog szerepköröket kapni.
|
|
promoteOption
|
ReadReplicaPromoteOption
|
A promoteMode tulajdonságban megadott művelet feldolgozásakor használható adatszinkronizálási beállítás. Ez a tulajdonság csak írható.
|
|
replicationState
|
ReplicationState
|
Az olvasási replika replikációs állapotát jelzi. Ezt a tulajdonságot a rendszer csak akkor adja vissza, ha a célkiszolgáló olvasási replika. A lehetséges értékek a következők: Aktív, Törött, Felzárkózás, Kiépítés, Újrakonfigurálás és Frissítés
|
|
role
|
ReplicationRole
|
A kiszolgáló szerepe egy replikációs készletben.
|
ReplicationRole
Felsorolás
A kiszolgáló szerepe egy replikációs készletben.
| Érték |
Description |
|
None
|
Nincs hozzárendelve replikációs szerepkör; A szerver önállóan működik.
|
|
Primary
|
Forráskiszolgálóként működik az egy vagy több replikára történő replikációhoz.
|
|
AsyncReplica
|
Aszinkron módon fogadja az adatokat egy azonos régión belüli elsődleges kiszolgálóról.
|
|
GeoAsyncReplica
|
Aszinkron módon fogadja az adatokat egy másik régióban található elsődleges kiszolgálóról a földrajzi redundancia érdekében.
|
ReplicationState
Felsorolás
Az olvasási replika replikációs állapotát jelzi. Ezt a tulajdonságot a rendszer csak akkor adja vissza, ha a célkiszolgáló olvasási replika. A lehetséges értékek a következők: Aktív, Törött, Felzárkózás, Kiépítés, Újrakonfigurálás és Frissítés
| Érték |
Description |
|
Active
|
Az olvasási replika teljesen szinkronizálva van, és aktívan replikálja az adatokat az elsődleges kiszolgálóról.
|
|
Catchup
|
Az olvasási replika az elsődleges kiszolgáló mögött található, és jelenleg felzárkózik a függőben lévő módosításokhoz.
|
|
Provisioning
|
Az olvasási replika létrehozása folyamatban van, és inicializálása folyamatban van.
|
|
Updating
|
Az olvasási replika bizonyos változásokon megy keresztül, megváltoztathatja a számítási méretet, hogy előléptesse az elsődleges kiszolgálóra.
|
|
Broken
|
A replikáció meghiúsult vagy megszakadt.
|
|
Reconfiguring
|
Az olvasási replika újrakonfigurálása folyamatban van, valószínűleg a forrás vagy a beállítások változásai miatt.
|
ServerForPatch
Tárgy
A frissíteni kívánt kiszolgálót jelöli.
| Name |
Típus |
Description |
|
identity
|
UserAssignedIdentity
|
Az alkalmazás identitását ismerteti.
|
|
properties.administratorLogin
|
string
|
A PostgreSQL-példányhoz rendelt első jelszóalapú rendszergazdaként kijelölt bejelentkezési név neve. Meg kell adni, amikor először engedélyezi a jelszóalapú hitelesítést egy kiszolgálón. Ha egy adott értékre van állítva, az a szerver élettartamának hátralévő részében nem módosítható. Ha letiltja a jelszóalapú hitelesítést egy olyan kiszolgálón, amelyen engedélyezve volt, ez a jelszóalapú szerepkör nem törlődik.
|
|
properties.administratorLoginPassword
|
string
(password)
|
A rendszergazdai bejelentkezéshez rendelt jelszó. Amíg a jelszó-hitelesítés engedélyezve van, ez a jelszó bármikor módosítható.
|
|
properties.authConfig
|
AuthConfigForPatch
|
Kiszolgáló hitelesítési konfigurációs tulajdonságai.
|
|
properties.availabilityZone
|
string
|
Kiszolgáló rendelkezésre állási zónája.
|
|
properties.backup
|
BackupForPatch
|
Kiszolgáló biztonsági mentési tulajdonságai.
|
|
properties.cluster
|
Cluster
|
Egy kiszolgáló fürttulajdonságai.
|
|
properties.createMode
|
CreateModeForPatch
|
Meglévő kiszolgáló frissítési módja.
|
|
properties.dataEncryption
|
DataEncryption
|
A kiszolgáló adattitkosítási tulajdonságai.
|
|
properties.highAvailability
|
HighAvailabilityForPatch
|
A kiszolgáló magas rendelkezésre állási tulajdonságai.
|
|
properties.maintenanceWindow
|
MaintenanceWindowForPatch
|
A kiszolgáló karbantartási időszakának tulajdonságai.
|
|
properties.network
|
Network
|
A kiszolgáló hálózati tulajdonságai. Csak akkor szükséges, ha azt szeretné, hogy a kiszolgáló integrálva legyen az ügyfél által biztosított virtuális hálózatba.
|
|
properties.replica
|
Replica
|
Kiszolgáló replikatulajdonságainak olvasása. Csak abban az esetben szükséges, ha elő szeretne léptetni egy szervert.
|
|
properties.replicationRole
|
ReplicationRole
|
A kiszolgáló szerepe egy replikációs készletben.
|
|
properties.storage
|
Storage
|
A kiszolgáló tárolási tulajdonságai.
|
|
properties.version
|
PostgresMajorVersion
|
A PostgreSQL adatbázismotor főverziója.
|
|
sku
|
SkuForPatch
|
Kiszolgáló számítási szintje és mérete.
|
|
tags
|
object
|
Alkalmazásspecifikus metaadatok kulcs-érték párok formájában.
|
ServerPublicNetworkAccessState
Felsorolás
Azt jelzi, hogy a nyilvános hálózati hozzáférés engedélyezve van-e vagy sem. Ez csak olyan kiszolgálók esetében támogatott, amelyek nincsenek integrálva olyan virtuális hálózatba, amelyet az ügyfél birtokol és biztosít a kiszolgáló telepítésekor.
| Érték |
Description |
|
Enabled
|
A nyilvános hálózati hozzáférés engedélyezve van. Ez lehetővé teszi a kiszolgáló elérését a nyilvános internetről, feltéve, hogy a csatlakozó ügyféltől érkező bejövő forgalmat engedélyező tűzfalszabály rendelkezésre áll. Ez kompatibilis a privát végpontok használatával a kiszolgálóhoz való csatlakozáshoz.
|
|
Disabled
|
A nyilvános hálózati hozzáférés le van tiltva. Ez azt jelenti, hogy a szerver nem érhető el a nyilvános internetről, hanem csak privát végpontokon keresztül.
|
SkuForPatch
Tárgy
Kiszolgáló számítási adatai.
| Name |
Típus |
Description |
|
name
|
string
|
Név, amely alapján a kiszolgálóhoz rendelt adott számítási méret ismert.
|
|
tier
|
SkuTier
|
A kiszolgálóhoz rendelt számítási szint.
|
SkuTier
Felsorolás
A kiszolgálóhoz rendelt számítási szint.
| Érték |
Description |
|
Burstable
|
Költséghatékony szint a ritka CPU-használathoz, ideális az alacsony teljesítményigényű számítási feladatok fejlesztéséhez és teszteléséhez.
|
|
GeneralPurpose
|
Kiegyensúlyozott számítási és memória a legtöbb számítási feladathoz, skálázható teljesítményt és I/O-átviteli sebességet kínálva.
|
|
MemoryOptimized
|
Magas memória-mag arány a gyors memóriában történő feldolgozást és nagy egyidejűséget igénylő nagy terhelésű számítási feladatokhoz.
|
Storage
Tárgy
A kiszolgáló tárolási tulajdonságai.
| Name |
Típus |
Description |
|
autoGrow
|
StorageAutoGrow
|
Jelölő, amely engedélyezi vagy letiltja a kiszolgáló tárterületének automatikus növekedését, ha a rendelkezésre álló terület nullához közeledik, és a feltételek lehetővé teszik a tárterület méretének automatikus növelését.
|
|
iops
|
integer
(int32)
|
A tároláshoz támogatott maximális IOPS-érték. Akkor szükséges, ha a tárolás típusa PremiumV2_LRS vagy UltraSSD_LRS.
|
|
storageSizeGB
|
integer
(int32)
|
A kiszolgálóhoz rendelt tárterület mérete.
|
|
throughput
|
integer
(int32)
|
A tároláshoz támogatott maximális átviteli sebesség. Akkor szükséges, ha a tárolás típusa PremiumV2_LRS vagy UltraSSD_LRS.
|
|
tier
|
AzureManagedDiskPerformanceTier
|
Kiszolgáló tárolási szintje.
|
|
type
|
StorageType
|
A kiszolgálóhoz rendelt tároló típusa. Az engedélyezett értékek a következők: Premium_LRS, PremiumV2_LRS vagy UltraSSD_LRS. Ha nincs megadva, alapértelmezés szerint Premium_LRS.
|
StorageAutoGrow
Felsorolás
Jelölő, amely engedélyezi vagy letiltja a kiszolgáló tárterületének automatikus növekedését, ha a rendelkezésre álló terület nullához közeledik, és a feltételek lehetővé teszik a tárterület méretének automatikus növelését.
| Érték |
Description |
|
Enabled
|
A kiszolgálónak automatikusan növelnie kell a tárterület méretét, ha a rendelkezésre álló terület közel nulla, és a feltételek lehetővé teszik a tárterület méretének automatikus növekedését.
|
|
Disabled
|
A kiszolgáló nem növelheti automatikusan a tárterület méretét, ha a rendelkezésre álló terület közel nulla.
|
StorageType
Felsorolás
A kiszolgálóhoz rendelt tároló típusa. Az engedélyezett értékek a következők: Premium_LRS, PremiumV2_LRS vagy UltraSSD_LRS. Ha nincs megadva, alapértelmezés szerint Premium_LRS.
| Érték |
Description |
|
Premium_LRS
|
A standard SSD-alapú tároló, amely konzisztens teljesítményt nyújt az általános célú számítási feladatokhoz.
|
|
PremiumV2_LRS
|
Következő generációs SSD-tároló jobb méretezhetőséggel és teljesítménnyel a nagy igénybevételt jelentő vállalati munkaterhelésekhez.
|
|
UltraSSD_LRS
|
Csúcskategóriás SSD-tároló extrém IOPS-hez és késésérzékeny alkalmazásokhoz.
|
UserAssignedIdentity
Tárgy
Kiszolgálóhoz társított identitások.
| Name |
Típus |
Description |
|
principalId
|
string
|
A felhasználó által hozzárendelt felügyelt identitáshoz társított szolgáltatásnév objektumának azonosítója.
|
|
tenantId
|
string
|
A kiszolgáló bérlőjének azonosítója.
|
|
type
|
IdentityType
|
A kiszolgálóhoz társított identitások típusai.
|
|
userAssignedIdentities
|
<string,
UserIdentity>
|
Felhasználó által hozzárendelt felügyelt identitások térképe.
|
UserIdentity
Tárgy
Felhasználó által hozzárendelt felügyelt identitás egy kiszolgálóhoz társítva.
| Name |
Típus |
Description |
|
clientId
|
string
|
A felhasználó által hozzárendelt felügyelt identitáshoz társított szolgáltatásnév ügyfelének azonosítója.
|
|
principalId
|
string
|
A felhasználó által hozzárendelt felügyelt identitáshoz társított szolgáltatásnév objektumának azonosítója.
|