Esempio n. 1
0
 /// <summary>
 /// The Get Storage Keys operation returns the primary and secondary
 /// access keys for the specified storage account.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='accountName'>
 /// The name of the desired storage account.
 /// </param>
 /// <returns>
 /// The primary and secondary access keys for a storage account.
 /// </returns>
 public static StorageAccountGetKeysResponse GetKeys(this IStorageAccountOperations operations, string accountName)
 {
     try
     {
         return(operations.GetKeysAsync(accountName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Get Storage Keys operation returns the primary and secondary
 /// access keys for the specified storage account.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the desired storage account.
 /// </param>
 /// <returns>
 /// The primary and secondary access keys for a storage account.
 /// </returns>
 public static Task <StorageAccountGetKeysResponse> GetKeysAsync(this IStorageAccountOperations operations, string accountName)
 {
     return(operations.GetKeysAsync(accountName, CancellationToken.None));
 }