class AzureCloudResourceService {

    public List<CloudResource> getAttachedOsDiskResources(AuthenticatedContext authenticatedContext, List<CloudResource> instanceList,
            String resourceGroupName) {

        List<CloudResource> osDiskList = new ArrayList<>();
        AzureClient client = authenticatedContext.getParameter(AzureClient.class);
        PagedList<VirtualMachine> virtualMachines = client.getVirtualMachines(resourceGroupName);
        virtualMachines.loadAll();

        instanceList.forEach(vm -> {
            Optional<VirtualMachine> matchingAzureVmOptional = virtualMachines
                    .stream()
                    .filter(azureVirtualMachine -> vm.getName().equals(azureVirtualMachine.name()))
                    .findFirst();
            matchingAzureVmOptional.ifPresentOrElse(
                    matchingAzureVm ->
                            osDiskList.add(collectOsDisk(vm.getInstanceId(), matchingAzureVm)),
                    () -> LOGGER.warn("No Azure VM metadata found for the VM: " + vm.getInstanceId()));
                }
        );

        return osDiskList;
    }

}