Files
azure-sdk-for-js/sdk/sql/arm-sql/samples-dev/jobPrivateEndpointsCreateOrUpdateSample.ts

35 lines
1.1 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { SqlManagementClient } from "@azure/arm-sql";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to creates or updates a private endpoint.
*
* @summary creates or updates a private endpoint.
* x-ms-original-file: 2025-01-01/CreateOrUpdateJobPrivateEndpoint.json
*/
async function createAPrivateEndpoint(): Promise<void> {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const client = new SqlManagementClient(credential, subscriptionId);
const result = await client.jobPrivateEndpoints.createOrUpdate(
"group1",
"server1",
"agent1",
"endpoint1",
{
targetServerAzureResourceId:
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1",
},
);
console.log(result);
}
async function main(): Promise<void> {
await createAPrivateEndpoint();
}
main().catch(console.error);