/// <summary> /// Adds a new server-level firewall rule for a SQL Database server /// that belongs to a subscription. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715280.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations. /// </param> /// <param name='serverName'> /// The name of the SQL database server to which this rule will be /// applied. /// </param> /// <param name='parameters'> /// Parameters for the Create Firewall Rule operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static FirewallRuleCreateResponse Create(this IFirewallRuleOperations operations, string serverName, FirewallRuleCreateParameters parameters) { try { return(operations.CreateAsync(serverName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Adds a new server-level firewall rule for a SQL Database server /// that belongs to a subscription. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715280.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IFirewallRuleOperations. /// </param> /// <param name='serverName'> /// The name of the SQL database server to which this rule will be /// applied. /// </param> /// <param name='parameters'> /// Parameters for the Create Firewall Rule operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <FirewallRuleCreateResponse> CreateAsync(this IFirewallRuleOperations operations, string serverName, FirewallRuleCreateParameters parameters) { return(operations.CreateAsync(serverName, parameters, CancellationToken.None)); }