/// <summary>
        /// Get or create new vm in a resource group.
        /// </summary>
        /// <param name="service"></param>
        /// <param name="resourceGroup"></param>
        /// <param name="name"></param>
        /// <param name="network"></param>
        /// <param name="image"></param>
        /// <returns></returns>
        public static async Task <IVirtualMachineResource> GetOrCreateAsync(
            this IVirtualMachineFactory service, IResourceGroupResource resourceGroup,
            string name, INetworkResource network = null, VirtualMachineImage image = null)
        {
            var resource = await Try.Async(() => service.GetAsync(resourceGroup, name));

            if (resource == null)
            {
                resource = await service.CreateAsync(resourceGroup, name, network, image, null);
            }
            return(resource);
        }
 /// <summary>
 /// Create a new linux virtual machine
 /// </summary>
 public static Task <IVirtualMachineResource> CreateAsync(
     this IVirtualMachineFactory service, IResourceGroupResource resourceGroup,
     string name, VirtualMachineImage image) =>
 service.CreateAsync(resourceGroup, name, null, image, null);