diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/azuremonitormetrics/azuremonitorprofile.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/azuremonitormetrics/azuremonitorprofile.py index dc574ea8657..d780b8b31fb 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/azuremonitormetrics/azuremonitorprofile.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/azuremonitormetrics/azuremonitorprofile.py @@ -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, @@ -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(