コード例 #1
0
        protected async Task <VirtualMachineContainer> GetVirtualMachineContainerAsync()
        {
            _genericResourceContainer = DefaultSubscription.GetGenericResources();
            _resourceGroup            = await CreateResourceGroupAsync();

            return(_resourceGroup.GetVirtualMachines());
        }
コード例 #2
0
        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);
        }