Exemple #1
0
 /// <summary>
 /// You can generate a new random password for publishing a site by
 /// issuing an HTTP POST request.  Tip: If you want to verify that the
 /// publish password has changed, call HTTP GET on /publishxml before
 /// calling /newpassword. In the publish XML, note the hash value in
 /// the userPWD attribute. After calling /newpassword, call
 /// /publishxml again. You can then compare the new value of userPWD
 /// in the Publish XML with the one you noted earlier.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236428.aspx
 /// for more information)
 /// </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>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse GeneratePassword(this IWebSiteOperations operations, string webSpaceName, string webSiteName)
 {
     try
     {
         return(operations.GeneratePasswordAsync(webSpaceName, webSiteName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// You can generate a new random password for publishing a site by
 /// issuing an HTTP POST request.  Tip: If you want to verify that the
 /// publish password has changed, call HTTP GET on /publishxml before
 /// calling /newpassword. In the publish XML, note the hash value in
 /// the userPWD attribute. After calling /newpassword, call
 /// /publishxml again. You can then compare the new value of userPWD
 /// in the Publish XML with the one you noted earlier.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn236428.aspx
 /// for more information)
 /// </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>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> GeneratePasswordAsync(this IWebSiteOperations operations, string webSpaceName, string webSiteName)
 {
     return(operations.GeneratePasswordAsync(webSpaceName, webSiteName, CancellationToken.None));
 }