@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public ServiceRegistry cosmosDbServiceRegistry(
        @Qualifier("cosmosDbObjectFactory")
        final CosmosDbObjectFactory cosmosDbObjectFactory,
        final ObjectProvider<List<ServiceRegistryListener>> serviceRegistryListeners,
        final ConfigurableApplicationContext applicationContext,
        final CasConfigurationProperties casProperties) {
        val cosmosDb = casProperties.getServiceRegistry().getCosmosDb();
        cosmosDbObjectFactory.createDatabaseIfNecessary();
        if (cosmosDb.isCreateContainer()) {
            cosmosDbObjectFactory.createContainer(cosmosDb.getContainer(), CosmosDbServiceRegistry.PARTITION_KEY);
        }
        val container = cosmosDbObjectFactory.getContainer(cosmosDb.getContainer());
        return new CosmosDbServiceRegistry(container, applicationContext,
            Optional.ofNullable(serviceRegistryListeners.getIfAvailable()).orElseGet(ArrayList::new));
    }
This is {@link CasCosmosDbServiceRegistryAutoConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-cosmosdb-service-registry/src/main/java/org/apereo/cas/config/CasCosmosDbServiceRegistryAutoConfiguration.java