summary import { ConnectionSharedKey , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function setVirtualNetworkGatewayConnectionSharedKey ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const virtualNetworkGatewayConnectionName = "connS2S" ; const parameters = { value : "AzureAbc123" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . virtualNetworkGatewayConnections . beginSetSharedKeyAndWait ( resourceGroupName , virtualNetworkGatewayConnectionName , parameters ) ; console . log ( result ) ; } setVirtualNetworkGatewayConnectionSharedKey ( ) . catch ( console . error ) ;