/// <summary> /// The Upload Client Root Certificate operation is used to upload a /// new client root certificate to Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn205129.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IClientRootCertificateOperations. /// </param> /// <param name='networkName'> /// Required. The name of the virtual network for this gateway. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Upload Client Root Certificate /// Virtual Network Gateway operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static GatewayOperationResponse Create(this IClientRootCertificateOperations operations, string networkName, ClientRootCertificateCreateParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IClientRootCertificateOperations)s).CreateAsync(networkName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// The Upload Client Root Certificate operation is used to upload a /// new client root certificate to Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn205129.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IClientRootCertificateOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network for this gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the Upload client certificate Virtual /// Network Gateway operation. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static GatewayOperationResponse Create(this IClientRootCertificateOperations operations, string virtualNetworkName, ClientRootCertificateCreateParameters parameters) { try { return operations.CreateAsync(virtualNetworkName, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Upload Client Root Certificate operation is used to upload a /// new client root certificate to Windows Azure. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn205129.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IClientRootCertificateOperations. /// </param> /// <param name='virtualNetworkName'> /// The name of the virtual network for this gateway. /// </param> /// <param name='parameters'> /// Parameters supplied to the Upload client certificate Virtual /// Network Gateway operation. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static Task<GatewayOperationResponse> CreateAsync(this IClientRootCertificateOperations operations, string virtualNetworkName, ClientRootCertificateCreateParameters parameters) { return operations.CreateAsync(virtualNetworkName, parameters, CancellationToken.None); }