summary import { VpnConnection , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function vpnConnectionPut ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const gatewayName = "gateway1" ; const connectionName = "vpnConnection1" ; const vpnConnectionParameters = { remoteVpnSite : { id : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1" } , trafficSelectorPolicies : [ ] , vpnLinkConnections : [ { name : "Connection-Link1" , connectionBandwidth : 200 , sharedKey : "key" , usePolicyBasedTrafficSelectors : false , vpnConnectionProtocolType : "IKEv2" , vpnLinkConnectionMode : "Default" , vpnSiteLink : { id : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1" } } ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . vpnConnections . beginCreateOrUpdateAndWait ( resourceGroupName , gatewayName , connectionName , vpnConnectionParameters ) ; console . log ( result ) ; } vpnConnectionPut ( ) . catch ( console . error ) ;