protected async Task <VirtualMachineContainer> GetVirtualMachineContainerAsync() { _genericResourceContainer = DefaultSubscription.GetGenericResources(); _resourceGroup = await CreateResourceGroupAsync(); return(_resourceGroup.GetVirtualMachines()); }
protected static async Task <int> GetResourceCountAsync(GenericResourceContainer genericResources, ResourceGroup rg = default) { int result = 0; var pageable = rg == null?genericResources.ListAsync() : genericResources.ListByResourceGroupAsync(rg.Id.Name); await foreach (var resource in pageable) { result++; } return(result); }