/// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='diskName'>
 /// The name of the disk being updated.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Disk operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static Task<VirtualMachineDiskUpdateDiskResponse> UpdateDiskAsync(this IVirtualMachineDiskOperations operations, string diskName, VirtualMachineDiskUpdateDiskParameters parameters)
 {
     return operations.UpdateDiskAsync(diskName, parameters, CancellationToken.None);
 }
 /// <summary>
 /// The Add Disk operation adds a disk to the user image repository.
 /// The disk can be an operating system disk or a data disk.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157178.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineDiskOperations.
 /// </param>
 /// <param name='diskName'>
 /// The name of the disk being updated.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Virtual Machine Disk operation.
 /// </param>
 /// <returns>
 /// A virtual machine disk associated with your subscription.
 /// </returns>
 public static VirtualMachineDiskUpdateDiskResponse UpdateDisk(this IVirtualMachineDiskOperations operations, string diskName, VirtualMachineDiskUpdateDiskParameters parameters)
 {
     try
     {
         return operations.UpdateDiskAsync(diskName, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }