Esempio n. 1
0
 /// <summary>
 /// The Create Storage Account operation creates a new storage account
 /// in Windows Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh264518.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Storage Account operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself.  If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request.  If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static StorageOperationStatusResponse Create(this IStorageAccountOperations operations, StorageAccountCreateParameters parameters)
 {
     try
     {
         return(operations.CreateAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Asynchronously creates a new storage account with the specified
 /// parameters. Existing accounts cannot be updated with this API and
 /// should instead use the Update Storage Account API. If an account
 /// is already created and subsequent create request is issued with
 /// exact same set of properties, the request succeeds.The max number
 /// of storage accounts that can be created per subscription is
 /// limited to 20.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group within the user’s
 /// subscription.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the storage account within the specified
 /// resource group. Storage account names must be between 3 and 24
 /// characters in length and use numbers and lower-case letters only.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters to provide for the created account.
 /// </param>
 /// <returns>
 /// The Create storage account operation response.
 /// </returns>
 public static Task <StorageAccountCreateResponse> CreateAsync(this IStorageAccountOperations operations, string resourceGroupName, string accountName, StorageAccountCreateParameters parameters)
 {
     return(operations.CreateAsync(resourceGroupName, accountName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// The Create Storage Account operation creates a new storage account
 /// in Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh264518.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Storage Account
 /// operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> CreateAsync(this IStorageAccountOperations operations, StorageAccountCreateParameters parameters)
 {
     return(operations.CreateAsync(parameters, CancellationToken.None));
 }