Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)
from azext_aks_preview.tests.latest.recording_processors import KeyReplacer
from azure.cli.command_modules.acs._format import version_to_tuple
from azure.cli.command_modules.acs.addonconfiguration import getRegionCodeForAzureRegion, sanitize_dcr_name
from azure.cli.core.azclierror import AzureInternalError, BadRequestError
from azure.cli.testsdk import CliTestError, ScenarioTest, live_only
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
Expand Down Expand Up @@ -2763,8 +2762,9 @@ def create_new_cluster_with_monitoring_aad_auth(self, resource_group, resource_g
workspace_resource_group = workspace_resource_id.split("/")[4]

# check that the DCR was created
region_code = getRegionCodeForAzureRegion(MockCmd(MockCLI()), resource_group_location)
dataCollectionRuleName = sanitize_dcr_name(f"MSCI-{region_code}-{aks_name}")
location = resource_group_location
dataCollectionRuleName = f"MSCI-{location}-{aks_name}"
dataCollectionRuleName = dataCollectionRuleName[0:64]
dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}"
get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01'
self.cmd(get_cmd, checks=[
Expand Down Expand Up @@ -2885,8 +2885,9 @@ def enable_monitoring_existing_cluster_aad_atuh(self, resource_group, resource_g
workspace_resource_group = workspace_resource_id.split("/")[4]

# check that the DCR was created
region_code = getRegionCodeForAzureRegion(MockCmd(MockCLI()), resource_group_location)
dataCollectionRuleName = sanitize_dcr_name(f"MSCI-{region_code}-{aks_name}")
location = resource_group_location
dataCollectionRuleName = f"MSCI-{location}-{aks_name}"
dataCollectionRuleName = dataCollectionRuleName[0:64]
dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}"
get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01'
self.cmd(get_cmd, checks=[
Expand Down Expand Up @@ -2948,8 +2949,9 @@ def test_aks_create_with_monitoring_legacy_auth(self, resource_group, resource_g

try:
# check that the DCR was created
region_code = getRegionCodeForAzureRegion(MockCmd(MockCLI()), resource_group_location)
dataCollectionRuleName = sanitize_dcr_name(f"MSCI-{region_code}-{aks_name}")
location = resource_group_location
dataCollectionRuleName = f"MSCI-{location}-{aks_name}"
dataCollectionRuleName = dataCollectionRuleName[0:64]
dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}"
get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2021-04-01'
self.cmd(get_cmd, checks=[
Expand Down