/// <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='name'> /// 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 VirtualMachineDiskUpdateResponse UpdateDisk(this IVirtualMachineDiskOperations operations, string name, VirtualMachineDiskUpdateParameters parameters) { try { return(operations.UpdateDiskAsync(name, parameters).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <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='name'> /// Required. The name of the disk being updated. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Virtual Machine Disk /// operation. /// </param> /// <returns> /// A virtual machine disk associated with your subscription. /// </returns> public static Task <VirtualMachineDiskUpdateResponse> UpdateDiskAsync(this IVirtualMachineDiskOperations operations, string name, VirtualMachineDiskUpdateParameters parameters) { return(operations.UpdateDiskAsync(name, parameters, CancellationToken.None)); }