Skip to content

Commit

Permalink
feat: Add support for all clouds except air gapped for microsoft.azur…
Browse files Browse the repository at this point in the history
…emonitor.containers.metrics in ARC clusters (managed prometheus)
  • Loading branch information
bragi92 committed Aug 29, 2024
1 parent 6a83e5b commit 407e425
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from azure.cli.core.azclierror import InvalidArgumentValueError
from azure.cli.core.azclierror import AzCLIError
from knack.util import CLIError
from .helper import (
get_cluster_region,
Expand Down Expand Up @@ -65,16 +65,8 @@ def ensure_azure_monitor_profile_prerequisites(
cluster_type
):
cloud_name = cmd.cli_ctx.cloud.name
if cloud_name.lower() == 'azurechinacloud':
raise CLIError("Azure China Cloud is not supported for the Azure Monitor Metrics extension")

if cloud_name.lower() == "azureusgovernment":
if safe_key_check('grafana-resource-id', configuration_settings):
grafana_resource_id = safe_value_get('grafana-resource-id', configuration_settings)
if grafana_resource_id is not None:
if grafana_resource_id != "":
raise InvalidArgumentValueError("Azure US Government cloud does not support Azure Managed Grarfana yet. Please follow this documenation for enabling it via the public cloud : aka.ms/ama-grafana-link-ff")

if cloud_name.lower() == "ussec" or cloud_name.lower() == "usdod":
raise AzCLIError(f"{cloud_name} does not support Azure Managed Prometheus yet.")
# Do RP registrations if required
rp_registrations(cmd, cluster_subscription)
link_azure_monitor_profile_artifacts(
Expand Down

0 comments on commit 407e425

Please sign in to comment.