Skip to content

Commit 512bd4c

Browse files
committed
Change to the 'canary' Copilot Access URL because the production URL doesn't work in some regions
1 parent 36afb32 commit 512bd4c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

shell/agents/Microsoft.Azure.Agent/ChatSession.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace Microsoft.Azure.Agent;
1111

1212
internal class ChatSession : IDisposable
1313
{
14-
private const string ACCESS_URL = "https://copilotweb.production.portalrp.azure.com/api/access?api-version=2024-09-01";
14+
// TODO: production URL not yet working for some regions.
15+
// private const string ACCESS_URL = "https://copilotweb.production.portalrp.azure.com/api/access?api-version=2024-09-01";
16+
private const string ACCESS_URL = "https://copilotweb.canary.production.portalrp.azure.com/api/access?api-version=2024-09-01";
17+
1518
private const string DL_TOKEN_URL = "https://copilotweb.production.portalrp.azure.com/api/conversations/start?api-version=2024-11-15";
1619
private const string CONVERSATION_URL = "https://directline.botframework.com/v3/directline/conversations";
1720

shell/agents/Microsoft.Azure.Agent/Utils.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ internal async static Task EnsureSuccessStatusCodeForTokenRequest(this HttpRespo
4040
if (!response.IsSuccessStatusCode)
4141
{
4242
string responseText = await response.Content.ReadAsStringAsync(CancellationToken.None);
43-
string message = $"{errorMessage} HTTP status: {response.StatusCode}, Response: {responseText}";
43+
if (string.IsNullOrEmpty(responseText))
44+
{
45+
responseText = "<empty>";
46+
}
47+
48+
string message = $"{errorMessage} HTTP status: {response.StatusCode}, Response: {responseText}.";
4449
Telemetry.Trace(AzTrace.Exception(message));
4550
throw new TokenRequestException(message);
4651
}

0 commit comments

Comments
 (0)