summary import { P2SVpnConnectionRequest , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function disconnectVpnConnectionsFromVirtualNetworkGateway ( ) { const subscriptionId = "subid" ; const resourceGroupName = "vpn-gateway-test" ; const virtualNetworkGatewayName = "vpngateway" ; const request = { vpnConnectionIds : [ "vpnconnId1" , "vpnconnId2" ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . virtualNetworkGateways . beginDisconnectVirtualNetworkGatewayVpnConnectionsAndWait ( resourceGroupName , virtualNetworkGatewayName , request ) ; console . log ( result ) ; } disconnectVpnConnectionsFromVirtualNetworkGateway ( ) . catch ( console . error ) ;