46 строки
1.6 KiB
TypeScript
46 строки
1.6 KiB
TypeScript
/*
|
|
* Copyright (c) Microsoft Corporation.
|
|
* Licensed under the MIT License.
|
|
*
|
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
*/
|
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
/**
|
|
* This sample demonstrates how to Update the state of specified private endpoint connection associated with the storage sync service.
|
|
*
|
|
* @summary Update the state of specified private endpoint connection associated with the storage sync service.
|
|
* x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateEndpointConnections_Create.json
|
|
*/
|
|
import {
|
|
PrivateEndpointConnection,
|
|
MicrosoftStorageSync
|
|
} from "@azure/arm-storagesync";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
async function privateEndpointConnectionsCreate() {
|
|
const subscriptionId = "{subscription-id}";
|
|
const resourceGroupName = "res7687";
|
|
const storageSyncServiceName = "sss2527";
|
|
const privateEndpointConnectionName = "{privateEndpointConnectionName}";
|
|
const properties: PrivateEndpointConnection = {
|
|
privateLinkServiceConnectionState: {
|
|
description: "Auto-Approved",
|
|
status: "Approved"
|
|
}
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new MicrosoftStorageSync(credential, subscriptionId);
|
|
const result = await client.privateEndpointConnections.beginCreateAndWait(
|
|
resourceGroupName,
|
|
storageSyncServiceName,
|
|
privateEndpointConnectionName,
|
|
properties
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
privateEndpointConnectionsCreate().catch(console.error);
|