/// <summary> /// The Generate VPN Client Package creates a VPN client package for /// the specified virtual network and gateway in Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn205126.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.VirtualNetworks.IGatewayOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network for this gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Virtual Network Gateway operation. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static Task<GatewayOperationResponse> GenerateVpnClientPackageAsync(this IGatewayOperations operations, string virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) { return operations.GenerateVpnClientPackageAsync(virtualNetworkName, parameters, CancellationToken.None); }
/// <summary> /// The Generate VPN Client Package creates a VPN client package for /// the specified virtual network and gateway in Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn205126.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.VirtualNetworks.IGatewayOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network for this gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Virtual Network Gateway operation. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static GatewayOperationResponse GenerateVpnClientPackage(this IGatewayOperations operations, string virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) { try { return operations.GenerateVpnClientPackageAsync(virtualNetworkName, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }