diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py index e9beb015249..8d5cf010cc3 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py @@ -5309,15 +5309,15 @@ def create_new_cluster_with_monitoring_aad_auth(self, resource_group, resource_g create_cmd += f'--ampls-resource-id {ampls_resource_id} ' if use_ampls else '' create_cmd += f'--enable-high-log-scale-mode ' if highlogscale_mode_enabled else '' - if enableOtherAddon: - # enable other addon such azure-policy to verify the monitoring addon and DCRs etc.. remainins intact. - self.cmd(f'aks enable-addons -a azure-policy -g={resource_group} -n={aks_name}') - response = self.cmd(create_cmd, checks=[ self.check('addonProfiles.omsagent.enabled', True), self.check('addonProfiles.omsagent.config.useAADAuth', 'true') ]).get_output_in_json() + if enableOtherAddon: + # enable other addon such azure-policy to verify the monitoring addon and DCRs etc.. remainins intact. + self.cmd(f'aks enable-addons -a azure-policy -g={resource_group} -n={aks_name}') + cluster_resource_id = response["id"] subscription = cluster_resource_id.split("/")[2] workspace_resource_id = response["addonProfiles"]["omsagent"]["config"]["logAnalyticsWorkspaceResourceID"]