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