@@ -31,21 +31,8 @@ async def create_or_get_agent(cls):
3131
3232 except Exception as e :
3333 error_msg = f"Failed to connect to Azure AI Project endpoint '{ app_settings .azure_ai .agent_endpoint } '. "
34-
35- if "Cannot connect to host" in str (e ):
36- error_msg += "This is likely a private endpoint DNS resolution issue. Please ensure:\n "
37- error_msg += "1. The private endpoint has a DNS zone group configured\n "
38- error_msg += "2. The private DNS zone 'privatelink.cognitiveservices.azure.com' is linked to your VNet\n "
39- error_msg += "3. Your App Service has VNet integration enabled\n "
40-
4134 error_msg += f"Original error: { str (e )} "
4235
43- track_event_if_configured ("TemplateAgentConnectionError" , {
44- "error" : str (e ),
45- "endpoint" : app_settings .azure_ai .agent_endpoint ,
46- "error_type" : "connection_failed"
47- })
48-
4936 raise Exception (error_msg )
5037
5138 agent_name = f"DG-TemplateAgent-{ app_settings .base_settings .solution_name } "
@@ -81,26 +68,10 @@ async def create_or_get_agent(cls):
8168 )
8269 except Exception as e :
8370 error_msg = f"Failed to create or update project index '{ index_name } '. "
84-
85- if "Cannot connect to host" in str (e ) and "search.windows.net" in str (e ):
86- error_msg += "This is likely a private endpoint DNS resolution issue for Azure AI Search. Please ensure:\n "
87- error_msg += "1. The Azure AI Search private endpoint has a DNS zone group configured\n "
88- error_msg += "2. The private DNS zone 'privatelink.search.windows.net' exists and is linked to your VNet\n "
89- error_msg += "3. Your App Service has VNet integration to the same VNet as the private endpoints\n "
90- error_msg += f"4. The search service endpoint resolves correctly from within the VNet\n "
91-
9271 error_msg += f"Connection name: { app_settings .datasource .connection_name } , "
9372 error_msg += f"Index: { app_settings .datasource .index } , "
9473 error_msg += f"Original error: { str (e )} "
9574
96- track_event_if_configured ("TemplateAgentIndexCreationError" , {
97- "error" : str (e ),
98- "index_name" : index_name ,
99- "connection_name" : app_settings .datasource .connection_name ,
100- "index" : app_settings .datasource .index ,
101- "error_type" : "search_connection_failed"
102- })
103-
10475 raise Exception (error_msg )
10576
10677 ai_search = AzureAISearchTool (
0 commit comments