Exemple #1
0
 /// <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 SwapSlots(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName)
 {
     try
     {
         return(operations.SwapSlotsAsync(webSpaceName, webSiteName, slotName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #2
0
 /// <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 Task <WebSiteOperationStatusResponse> SwapSlotsAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName, string slotName)
 {
     return(operations.SwapSlotsAsync(webSpaceName, webSiteName, slotName, CancellationToken.None));
 }