public async Task UpdateAnomalyDetectionConfigurationAsync()
        {
            string endpoint        = MetricsAdvisorUri;
            string subscriptionKey = MetricsAdvisorSubscriptionKey;
            string apiKey          = MetricsAdvisorApiKey;
            var    credential      = new MetricsAdvisorKeyCredential(subscriptionKey, apiKey);

            var adminClient = new MetricsAdvisorAdministrationClient(new Uri(endpoint), credential);

            string detectionConfigurationId = DetectionConfigurationId;

            Response <AnomalyDetectionConfiguration> response = await adminClient.GetMetricAnomalyDetectionConfigurationAsync(detectionConfigurationId);

            AnomalyDetectionConfiguration detectionConfiguration = response.Value;

            string originalDescription = detectionConfiguration.Description;

            detectionConfiguration.Description = "This description was generated by a sample.";

            await adminClient.UpdateMetricAnomalyDetectionConfigurationAsync(detectionConfigurationId, detectionConfiguration);

            // Undo the changes to leave the detection configuration unaltered. Skip this step if you intend to keep
            // the changes.

            detectionConfiguration.Description = originalDescription;
            await adminClient.UpdateMetricAnomalyDetectionConfigurationAsync(detectionConfigurationId, detectionConfiguration);
        }
        public async Task GetAnomalyDetectionConfigurationAsync()
        {
            string endpoint        = MetricsAdvisorUri;
            string subscriptionKey = MetricsAdvisorSubscriptionKey;
            string apiKey          = MetricsAdvisorApiKey;
            var    credential      = new MetricsAdvisorKeyCredential(subscriptionKey, apiKey);

            var adminClient = new MetricsAdvisorAdministrationClient(new Uri(endpoint), credential);

            string detectionConfigurationId = DetectionConfigurationId;

            Response <AnomalyDetectionConfiguration> response = await adminClient.GetMetricAnomalyDetectionConfigurationAsync(detectionConfigurationId);

            AnomalyDetectionConfiguration detectionConfiguration = response.Value;

            Console.WriteLine($"Detection configuration metric ID: {detectionConfiguration.MetricId}");
            Console.WriteLine($"Detection configuration name: {detectionConfiguration.Name}");
            Console.WriteLine($"Detection configuration description: {detectionConfiguration.Description}");
        }