mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/postgresql/DBforPostgreSQL.Management/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: 'd5ee6b87272dea7413a15e1403db07fe0450316a' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6405188 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. **Release plan link:** [https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=2264](https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=2264) **Submitted by**: [email protected] --------- Co-authored-by: kazrael2119 <[email protected]>
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to deletes an existing server administrator associated to a Microsoft Entra principal.
|
|
*
|
|
* @summary deletes an existing server administrator associated to a Microsoft Entra principal.
|
|
* x-ms-original-file: 2026-04-01-preview/AdministratorsMicrosoftEntraDelete.json
|
|
*/
|
|
async function deleteAServerAdministratorAssociatedToAMicrosoftEntraPrincipal(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
|
|
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
|
|
await client.administratorsMicrosoftEntra.delete(
|
|
"exampleresourcegroup",
|
|
"exampleserver",
|
|
"oooooooo-oooo-oooo-oooo-oooooooooooo",
|
|
);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await deleteAServerAdministratorAssociatedToAMicrosoftEntraPrincipal();
|
|
}
|
|
|
|
main().catch(console.error);
|