in CredentialProvider.Microsoft/CredentialProviders/Vsts/IAuthUtil.cs [88:107]
public async Task<AzDevDeploymentType> GetAzDevDeploymentType(Uri uri)
{
// Ping the url to see from headers whether it's an Azure Artifacts feed or external
var responseHeaders = await GetResponseHeadersAsync(uri, cancellationToken: default);
// Hosted only allows https
if (IsHttpsScheme(uri) && responseHeaders.Contains(VssResourceTenant) && responseHeaders.Contains(VssAuthorizationEndpoint))
{
return AzDevDeploymentType.Hosted;
}
// If not hosted and has E2EID, assume on prem.
if (responseHeaders.Contains(VssE2EID))
{
return AzDevDeploymentType.OnPrem;
}
// Assume uri is from an external source if expected headers aren't present.
return AzDevDeploymentType.External;
}