/// <summary> /// You can swap a web site from one slot to the production slot. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// The name of the web space. /// </param> /// <param name='webSiteName'> /// The name of the web site. /// </param> /// <param name='slotName'> /// The name of the web site slot to swap with the production slot. /// </param> /// <returns> /// The response body contains the status of the specified long-running /// operation, indicating whether it has succeeded, is inprogress, has /// time dout, or has failed. Note that this status is distinct from /// the HTTP status code returned for the Get Operation Status /// operation itself. If the long-running operation failed, the /// response body includes error information regarding the failure. /// </returns> public static WebSiteOperationStatusResponse BeginSwapingSlots(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName) { try { return operations.BeginSwapingSlotsAsync(webSpaceName, webSiteName, slotName).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// You can swap a web site from one slot to another slot. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations. /// </param> /// <param name='webSpaceName'> /// Required. The name of the web space. /// </param> /// <param name='webSiteName'> /// Required. The name of the web site. /// </param> /// <param name='sourceSlotName'> /// Required. The name of the first web site slot to swap (source). /// </param> /// <param name='targetSlotName'> /// Required. The name of the second web site slot to swap with /// (target). /// </param> /// <returns> /// The response body contains the status of the specified long-running /// operation, indicating whether it has succeeded, is inprogress, has /// timed out, or has failed. Note that this status is distinct from /// the HTTP status code returned for the Get Operation Status /// operation itself. If the long-running operation failed, the /// response body includes error information regarding the failure. /// </returns> public static Task<WebSiteOperationStatusResponse> BeginSwapingSlotsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string sourceSlotName, string targetSlotName) { return operations.BeginSwapingSlotsAsync(webSpaceName, webSiteName, sourceSlotName, targetSlotName, CancellationToken.None); }