I have an account in Azure AD and have successfully set up and deployed an Azure App Service by logging in to portal.azure.com and manually deploying from a GitHub repo.
I'm trying to debug the app from Visual Studio 2022 (v 17.5) and when I get prompted to sign in to my Azure account, I use my Microsoft account (same one I signed in to portal.azure.com with) and it successfully authenticates but the dialog does not load any subscription information and continues to prompt me to sign in (doesn't matter how many times I successfully do this).
I change an authentication setting within VS to use the "System Web Browser" for authenticating, and signed out of Visual Studio. Then when I logged back in I got this error:
"The following tenants were not added to the account ******@outlook.com 'f8cdef31-a31e-4b4a-93e4-5f571e91255a' - for more information check the logs..."
I checked the logs and saw things like the entries below. Is there any way I can get properly authenticated into my Azure account from VS 2022?
02/26/2023 08:49:23 Central Standard Time : Error : Attempt 1 to call 'v1.0/me', failed with an error: 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:23 Central Standard Time : Error : Retry count met, for 'v1.0/me' calls, giving up.
02/26/2023 08:49:24 Central Standard Time : Error : Attempt 1 to call '/f8cdef31-a31e-4b4a-93e4-5f571e91255a/me?api-version=1.6', failed with an error: 'System.UnauthorizedAccessException: Unauthorized to access 'https://graph.windows.net/f8cdef31-a31e-4b4a-93e4-5f571e91255a/me?api-version=1.6'. Forbidden
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:26 Central Standard Time : Error : Attempt 1 to call 'v1.0/organization/f8cdef31-a31e-4b4a-93e4-5f571e91255a', failed with an error: 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:27 Central Standard Time : Error : Attempt 2 to call 'v1.0/organization/f8cdef31-a31e-4b4a-93e4-5f571e91255a', failed with an error: 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:29 Central Standard Time : Error : Attempt 3 to call 'v1.0/organization/f8cdef31-a31e-4b4a-93e4-5f571e91255a', failed with an error: 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:29 Central Standard Time : Error : Retry count met, for 'v1.0/organization/f8cdef31-a31e-4b4a-93e4-5f571e91255a' calls, giving up.
02/26/2023 08:49:29 Central Standard Time : Error : Failed getting tenant details preferred client exception 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)
at async Task<(string displayName, string defaultDomainName)> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.Graph.GraphClient+AbstractGraphClient.GetTenantDetailsAsync(GraphTokenRequestParameters tokenRequestParameters, CancellationToken cancellationToken)
at async Task<(string displayName, string defaultDomainName)> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.Graph.GraphClient.GetTenantDetailsAsync(GraphTokenRequestParameters tokenRequestParameters, CancellationToken cancellationToken)'
02/26/2023 08:49:30 Central Standard Time : Error : Attempt 1 to call '/f8cdef31-a31e-4b4a-93e4-5f571e91255a/tenantDetails?api-version=1.6', failed with an error: 'System.UnauthorizedAccessException: Unauthorized to access 'https://graph.windows.net/f8cdef31-a31e-4b4a-93e4-5f571e91255a/tenantDetails?api-version=1.6'. Forbidden
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)'
02/26/2023 08:49:30 Central Standard Time : Error : Failed getting tenant details fallback exception 'System.UnauthorizedAccessException: Unauthorized to access 'https://graph.windows.net/f8cdef31-a31e-4b4a-93e4-5f571e91255a/tenantDetails?api-version=1.6'. Forbidden
at async Task<HttpResponseMessage> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.SendAsync(HttpRequestMessage request, ITelemetryOperation telemetryOp, CancellationToken cancellationToken)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)
at async Task<TResult> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.HttpClientWrapper.GetResponseAsync<TResult>(Func<IAadConfiguration, CancellationToken, Task<Uri>> hostProvider, Uri apiUri, GraphTokenRequestParameters authParameters, Func<HttpResponseMessage, Task<TResult>> transformation, ITelemetryOperation telemetryOp, int attemptCount, CancellationToken cancellationToken, string callerName)
at async Task<(string displayName, string defaultDomainName)> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.Graph.GraphClient+AbstractGraphClient.GetTenantDetailsAsync(GraphTokenRequestParameters tokenRequestParameters, CancellationToken cancellationToken)
at async Task<(string displayName, string defaultDomainName)> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.Graph.GraphClient.GetTenantDetailsAsync(GraphTokenRequestParameters tokenRequestParameters, CancellationToken cancellationToken)'
02/26/2023 08:49:30 Central Standard Time : Error : Skipping tenant 'f8cdef31-a31e-4b4a-93e4-5f571e91255a' error getting friendly name: 'System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at async Task<(string displayName, string defaultDomainName)> Microsoft.Developer.IdentityService.AccountProvider.AADAccountProvider.Graph.GraphClient.GetTenantDetailsAsync(GraphTokenRequestParameters tokenRequestParameters, CancellationToken cancellationToken)
at async Task Microsoft.Developer.IdentityService.AccountProvider.AadAccountProviderNetworkServicesBase.GetTenantDetailsAsync(TenantInformation partialTenantInfo, AuthenticationInfo authInfo, bool promptIfNeeded, string queryParameters, AuthenticationFlowType authenticationFlowType, Dictionary<string, string> additionalAuthProperties, CancellationToken cancellationToken)
at async Task Microsoft.Developer.IdentityService.AccountProvider.AadAccountProviderService.TryGetTenantDetailsAsync(AuthenticationInfo authInfo, bool promptIfNeeded, string queryParameters, AuthenticationFlowType authenticationFlowType, Dictionary<string, string> additionalAuthProperties, List<TenantInformation> tenants, HashSet<MissingTenantInfo> missingTenants, CancellationToken cancellationToken)'