From 6c56613a6844d28c1895e3fde1f6e7f86e7a4681 Mon Sep 17 00:00:00 2001 From: bragi92 Date: Wed, 28 Sep 2022 12:18:54 -0700 Subject: [PATCH] {AKS - ARC} fix: Update DCR creation to Clusters resource group instead of workspace (#175) * fix: Update DCR creation to Clusters resource group instead of workspace * . * . * casing check --- .../partner_extensions/ContainerInsights.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py index 8f1271b2593..fbbc45ac325 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py @@ -587,8 +587,8 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_ raise ex # extract subscription ID and resource group from workspace_resource_id URL - parsed = parse_resource_id(workspace_resource_id) - workspace_subscription_id, workspace_resource_group = parsed["subscription"], parsed["resource_group"] + parsed = parse_resource_id(workspace_resource_id.lower()) + workspace_subscription_id = parsed["subscription"] workspace_region = '' resources = cf_resources(cmd.cli_ctx, workspace_subscription_id) try: @@ -601,7 +601,7 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_ raise ex dataCollectionRuleName = f"MSCI-{cluster_name}-{cluster_region}" - dcr_resource_id = f"/subscriptions/{workspace_subscription_id}/resourceGroups/{workspace_resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}" + dcr_resource_id = f"/subscriptions/{subscription_id}/resourceGroups/{cluster_resource_group_name}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}" # first get the association between region display names and region IDs (because for some reason # the "which RPs are available in which regions" check returns region display names)