/// <summary> /// The Add OS Image operation adds an operating system image that is /// stored in a storage account and is available from the image /// repository. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157192.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Virtual Machine Image operation. /// </param> /// <returns> /// Parameters returned from the Create Virtual Machine Image operation. /// </returns> public static VirtualMachineImageCreateResponse Create(this IVirtualMachineImageOperations operations, VirtualMachineImageCreateParameters parameters) { try { return operations.CreateAsync(parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Add OS Image operation adds an operating system image that is /// stored in a storage account and is available from the image /// repository. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157192.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineImageOperations. /// </param> /// <param name='parameters'> /// Parameters supplied to the Create Virtual Machine Image operation. /// </param> /// <returns> /// Parameters returned from the Create Virtual Machine Image operation. /// </returns> public static Task<VirtualMachineImageCreateResponse> CreateAsync(this IVirtualMachineImageOperations operations, VirtualMachineImageCreateParameters parameters) { return operations.CreateAsync(parameters, CancellationToken.None); }