/// <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='serverFarmName'> /// The name of the server farm. /// </param> /// <returns> /// The Get Server Farm operation response. /// </returns> public static ServerFarmGetResponse Get(this IServerFarmOperations operations, string webSpaceName, string serverFarmName) { try { return(operations.GetAsync(webSpaceName, serverFarmName).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='serverFarmName'> /// The name of the server farm. /// </param> /// <returns> /// The Get Server Farm operation response. /// </returns> public static Task <ServerFarmGetResponse> GetAsync(this IServerFarmOperations operations, string webSpaceName, string serverFarmName) { return(operations.GetAsync(webSpaceName, serverFarmName, CancellationToken.None)); }