diff --git a/src/azure-cli/azure/cli/command_modules/acs/addonconfiguration.py b/src/azure-cli/azure/cli/command_modules/acs/addonconfiguration.py index 567bdbdc82a..af735bee72e 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/addonconfiguration.py +++ b/src/azure-cli/azure/cli/command_modules/acs/addonconfiguration.py @@ -377,9 +377,10 @@ def ensure_container_insights_for_monitoring( region_ids = map( lambda x: region_names_to_id[x], resource["locations"]) if cluster_region not in region_ids: - raise ClientRequestError(f"Data Collection Rule Associations are not supported for cluster region {cluster_region}") + raise ClientRequestError( + f"Data Collection Rule Associations are not supported for cluster region {cluster_region}") dcr_url = cmd.cli_ctx.cloud.endpoints.resource_manager + \ - f"{dcr_resource_id}?api-version=2019-11-01-preview" + f"{dcr_resource_id}?api-version=2021-04-01" # get existing tags on the container insights extension DCR if the customer added any existing_tags = get_existing_container_insights_extension_dcr_tags( cmd, dcr_url) @@ -394,18 +395,7 @@ def ensure_container_insights_for_monitoring( { "name": "ContainerInsightsExtension", "streams": [ - "Microsoft-Perf", - "Microsoft-ContainerInventory", - "Microsoft-ContainerLog", - "Microsoft-ContainerLogV2", - "Microsoft-ContainerNodeInventory", - "Microsoft-KubeEvents", - "Microsoft-KubeMonAgentEvents", - "Microsoft-KubeNodeInventory", - "Microsoft-KubePodInventory", - "Microsoft-KubePVInventory", - "Microsoft-KubeServices", - "Microsoft-InsightsMetrics", + "Microsoft-ContainerInsights-Group-Default" ], "extensionName": "ContainerInsights", } @@ -414,18 +404,7 @@ def ensure_container_insights_for_monitoring( "dataFlows": [ { "streams": [ - "Microsoft-Perf", - "Microsoft-ContainerInventory", - "Microsoft-ContainerLog", - "Microsoft-ContainerLogV2", - "Microsoft-ContainerNodeInventory", - "Microsoft-KubeEvents", - "Microsoft-KubeMonAgentEvents", - "Microsoft-KubeNodeInventory", - "Microsoft-KubePodInventory", - "Microsoft-KubePVInventory", - "Microsoft-KubeServices", - "Microsoft-InsightsMetrics", + "Microsoft-ContainerInsights-Group-Default" ], "destinations": ["la-workspace"], } @@ -465,7 +444,7 @@ def ensure_container_insights_for_monitoring( } ) association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + \ - f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version=2019-11-01-preview" + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version=2021-04-01" for _ in range(3): try: send_raw_request( diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py index 5236b7f16ff..77ce3240b3e 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py @@ -6533,14 +6533,14 @@ def create_new_cluster_with_monitoring_aad_auth(self, resource_group, resource_g # check that the DCR was created dataCollectionRuleName = f"MSCI-{aks_name}-{resource_group_location}" dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{workspace_resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}" - get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2019-11-01-preview' + get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01' self.cmd(get_cmd, checks=[ self.check('properties.destinations.logAnalytics[0].workspaceResourceId', f'{workspace_resource_id}') ]) # check that the DCR-A was created dcra_resource_id = f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension" - get_cmd = f'rest --method get --url https://management.azure.com{dcra_resource_id}?api-version=2019-11-01-preview' + get_cmd = f'rest --method get --url https://management.azure.com{dcra_resource_id}?api-version=2021-04-01' self.cmd(get_cmd, checks=[ self.check('properties.dataCollectionRuleId', f'{dcr_resource_id}') ]) @@ -6606,14 +6606,14 @@ def enable_monitoring_existing_cluster_aad_auth(self, resource_group, resource_g # check that the DCR was created dataCollectionRuleName = f"MSCI-{aks_name}-{resource_group_location}" dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{workspace_resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}" - get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2019-11-01-preview' + get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01' self.cmd(get_cmd, checks=[ self.check('properties.destinations.logAnalytics[0].workspaceResourceId', f'{workspace_resource_id}') ]) # check that the DCR-A was created dcra_resource_id = f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension" - get_cmd = f'rest --method get --url https://management.azure.com{dcra_resource_id}?api-version=2019-11-01-preview' + get_cmd = f'rest --method get --url https://management.azure.com{dcra_resource_id}?api-version=2021-04-01' self.cmd(get_cmd, checks=[ self.check('properties.dataCollectionRuleId', f'{dcr_resource_id}') ]) @@ -6660,7 +6660,7 @@ def test_aks_create_with_monitoring_legacy_auth(self, resource_group, resource_g # check that the DCR was created dataCollectionRuleName = f"MSCI-{aks_name}-{resource_group_location}" dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{workspace_resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}" - get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2019-11-01-preview' + get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01' self.cmd(get_cmd, checks=[ self.check('properties.destinations.logAnalytics[0].workspaceResourceId', f'{workspace_resource_id}') ])