diff --git a/src/Runner.Listener/Configuration/ConfigurationManager.cs b/src/Runner.Listener/Configuration/ConfigurationManager.cs index e83eab1e1..4021ad1bc 100644 --- a/src/Runner.Listener/Configuration/ConfigurationManager.cs +++ b/src/Runner.Listener/Configuration/ConfigurationManager.cs @@ -135,7 +135,7 @@ namespace GitHub.Runner.Listener.Configuration runnerSettings.GitHubUrl = inputUrl; registerToken = await GetRunnerTokenAsync(command, inputUrl, "registration"); GitHubAuthResult authResult = await GetTenantCredential(inputUrl, registerToken, Constants.RunnerEvent.Register); - runnerSettings.ServerUrl = authResult.TenantUrl; + runnerSettings.ServerUrl = authResult.LegacyUrl ?? authResult.TenantUrl; runnerSettings.UseV2Flow = authResult.UseV2Flow; Trace.Info($"Using V2 flow: {runnerSettings.UseV2Flow}"); creds = authResult.ToVssCredentials(); diff --git a/src/Runner.Listener/Configuration/CredentialManager.cs b/src/Runner.Listener/Configuration/CredentialManager.cs index f13fb1207..890b51245 100644 --- a/src/Runner.Listener/Configuration/CredentialManager.cs +++ b/src/Runner.Listener/Configuration/CredentialManager.cs @@ -96,6 +96,9 @@ namespace GitHub.Runner.Listener.Configuration [DataMember(Name = "use_v2_flow")] public bool UseV2Flow { get; set; } + [DataMember(Name = "legacy_url")] + public string LegacyUrl { get; set; } + public VssCredentials ToVssCredentials() { ArgUtil.NotNullOrEmpty(TokenSchema, nameof(TokenSchema));