It could be because of following reasons:
- Please check your hostname in your connection string is that correct?
- Please check is there any network traffic blockage on specific DSN you are dealing with?
- Please confirm are you using correct connection string?
for your reference please see following link official documentation of Azure AI foundry it could be helpful for you
May be following code could solve your issue:
var connectionString = Environment.GetEnvironmentVariable("PROJECT_CONNECTION_STRING");
var parts = connectionString.Split(';');
if (parts.Length != 4)
throw new InvalidOperationException("Connection string format invalid.");
var host = parts[0];
System.Net.Dns.GetHostEntry(host);
Hopefully it may solve your issue . cheers!