Exemple #1
0
        public async Task ClientSecureStringTest()
        {
            var clientBuilder = TestCommon.GetDefaultSecureStringConfiguration();

            using (CosmosClient client = clientBuilder.Build())
            {
                await client.GetAccountSettingsAsync();
            }
        }
        public async Task <HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
        {
            try
            {
                using (var cosmosDbClient = new CosmosClient(_connectionString))
                {
                    await cosmosDbClient.GetAccountSettingsAsync();

                    return(HealthCheckResult.Healthy());
                }
            }
            catch (Exception ex)
            {
                return(new HealthCheckResult(context.Registration.FailureStatus, exception: ex));
            }
        }