/// <summary> /// The Add certificate operation adds the ssl certificate to the /// application gateway (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IApplicationGatewayOperations. /// </param> /// <param name='gatewayName'> /// Required. Gateway name /// </param> /// <param name='certificateName'> /// Required. Certificate name /// </param> /// <param name='certificate'> /// Required. The application gateway ssl certificate /// </param> /// <returns> /// The response body contains the status of the specified asynchronous /// operation, indicating whether it has succeeded, is inprogress, or /// has failed. Note that this status is distinct from the HTTP status /// code returned for the Get Operation Status operation itself. If /// the asynchronous operation succeeded, the response body includes /// the HTTP status code for the successful request. If the /// asynchronous operation failed, the response body includes the HTTP /// status code for the failed request, and also includes error /// information regarding the failure. /// </returns> public static ApplicationGatewayOperationResponse AddCertificate(this IApplicationGatewayOperations operations, string gatewayName, string certificateName, ApplicationGatewayCertificate certificate) { return Task.Factory.StartNew((object s) => { return ((IApplicationGatewayOperations)s).AddCertificateAsync(gatewayName, certificateName, certificate); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// The Begin Add certificate operation adds the ssl certificate to the /// application gateway (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154114.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Network.IApplicationGatewayOperations. /// </param> /// <param name='gatewayName'> /// Required. Gateway name /// </param> /// <param name='certificateName'> /// Required. Certificate name /// </param> /// <param name='certificate'> /// Required. The application gateway ssl certificate /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<GatewayOperationResponse> BeginAddCertificateAsync(this IApplicationGatewayOperations operations, string gatewayName, string certificateName, ApplicationGatewayCertificate certificate) { return operations.BeginAddCertificateAsync(gatewayName, certificateName, certificate, CancellationToken.None); }