/// <summary> /// You can create a server farm by issuing an HTTP POST request. Only /// one server farm per webspace is permitted. You can retrieve server /// farm details by using HTTP GET, change server farm properties by /// using HTTP PUT, and delete a server farm by using HTTP DELETE. A /// request body is required for server farm creation (HTTP POST) and /// server farm update (HTTP PUT). Warning: Creating a server farm /// changes your webspace’s Compute Mode from Shared to Dedicated. You /// will be charged from the moment the server farm is created, even /// if all your sites are still running in Free mode. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn194277.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IServerFarmOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Server Farm operation. /// </param> /// <returns> /// The Create Server Farm operation response. /// </returns> public static ServerFarmCreateResponse Create(this IServerFarmOperations operations, string webSpaceName, ServerFarmCreateParameters parameters) { try { return(operations.CreateAsync(webSpaceName, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can create a server farm by issuing an HTTP POST request. Only /// one server farm per webspace is permitted. You can retrieve server /// farm details by using HTTP GET, change server farm properties by /// using HTTP PUT, and delete a server farm by using HTTP DELETE. A /// request body is required for server farm creation (HTTP POST) and /// server farm update (HTTP PUT). Warning: Creating a server farm /// changes your webspace’s Compute Mode from Shared to Dedicated. You /// will be charged from the moment the server farm is created, even /// if all your sites are still running in Free mode. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/dn194277.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IServerFarmOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Server Farm operation. /// </param> /// <returns> /// The Create Server Farm operation response. /// </returns> public static Task <ServerFarmCreateResponse> CreateAsync(this IServerFarmOperations operations, string webSpaceName, ServerFarmCreateParameters parameters) { return(operations.CreateAsync(webSpaceName, parameters, CancellationToken.None)); }