@@ -179,6 +179,19 @@ def _setup_helm_deployment(console, aks_agent_manager: AKSAgentManager):
179179 f"\n 👤 Current service account in namespace '{ aks_agent_manager .namespace } ': { service_account_name } " ,
180180 style = "cyan" )
181181
182+ # Check if using Azure Entra ID provider and show role assignment reminder
183+ model_list = aks_agent_manager .get_llm_config ()
184+ if model_list and any ("azure/" in model_name and not model_config .get ("api_key" ) for model_name , model_config in model_list .items ()):
185+ console .print (
186+ f"\n ⚠️ IMPORTANT: If using keyless authentication with Azure OpenAI, ensure the 'Cognitive Services OpenAI User' or 'Azure AI Developer' role "
187+ f"is assigned to the workload identity (service account: { service_account_name } )." ,
188+ style = f"bold { INFO_COLOR } "
189+ )
190+ console .print (
191+ "Learn more: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity\n " ,
192+ style = INFO_COLOR
193+ )
194+
182195 elif helm_status == "not_found" :
183196 console .print (
184197 f"Helm chart not deployed (status: { helm_status } ). Setting up deployment..." ,
@@ -197,6 +210,19 @@ def _setup_helm_deployment(console, aks_agent_manager: AKSAgentManager):
197210 "'azure.workload.identity/client-id: <managed-identity-client-id>'." ,
198211 style = WARNING_COLOR )
199212
213+ # Check if using Azure Entra ID provider and show role assignment note
214+ model_list = aks_agent_manager .get_llm_config ()
215+ if model_list and any ("azure/" in model_name and not model_config .get ("api_key" ) for model_name , model_config in model_list .items ()):
216+ console .print (
217+ "\n ⚠️ NOTE: You are using keyless authentication with Azure OpenAI. "
218+ "Ensure the 'Cognitive Services OpenAI User' or 'Azure AI Developer' role is assigned to the workload identity." ,
219+ style = f"bold { INFO_COLOR } "
220+ )
221+ console .print (
222+ "Learn more: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity" ,
223+ style = INFO_COLOR
224+ )
225+
200226 # Prompt user for service account name (required)
201227 while True :
202228 user_input = console .input (
@@ -422,6 +448,7 @@ def aks_agent_cleanup(
422448 cluster_name ,
423449 namespace ,
424450 mode = None ,
451+ yes = False ,
425452):
426453 """Cleanup and uninstall the AKS agent."""
427454 with CLITelemetryClient (event_type = "cleanup" ) as telemetry_client :
@@ -442,16 +469,17 @@ def aks_agent_cleanup(
442469 f"⚠️ Warning: --namespace '{ namespace } ' is specified but will be ignored in client mode." ,
443470 style = WARNING_COLOR )
444471
445- console .print (
446- "\n ⚠️ Warning: This will uninstall the AKS agent and delete all associated resources." ,
447- style = WARNING_COLOR )
472+ if not yes :
473+ console .print (
474+ "\n ⚠️ Warning: This will uninstall the AKS agent and delete all associated resources." ,
475+ style = WARNING_COLOR )
448476
449- user_confirmation = console .input (
450- f"\n [{ WARNING_COLOR } ]Are you sure you want to proceed with cleanup? (y/N): [/]" ).strip ().lower ()
477+ user_confirmation = console .input (
478+ f"\n [{ WARNING_COLOR } ]Are you sure you want to proceed with cleanup? (y/N): [/]" ).strip ().lower ()
451479
452- if user_confirmation not in ['y' , 'yes' ]:
453- console .print ("❌ Cleanup cancelled." , style = INFO_COLOR )
454- return
480+ if user_confirmation not in ['y' , 'yes' ]:
481+ console .print ("❌ Cleanup cancelled." , style = INFO_COLOR )
482+ return
455483
456484 console .print ("\n 🗑️ Starting cleanup (this typically takes a few seconds)..." , style = INFO_COLOR )
457485
0 commit comments