Visual Studio login fails , MFA notification not received, while MFA works for other Microsoft 365 apps

SM 0 Reputation points
2026-04-14T11:04:00.75+00:00

The user is unable to successfully sign in to Visual Studio. During the authentication process:

  • The login redirects to Microsoft sign-in page
  • MFA is triggered (number matching screen appears)
  • However, the user does not receive the approval notification on the mobile device (Microsoft Authenticator)
  • When attempting to use OTP (verification code), it sometimes shows as invalid/incorrect

After authentication attempt, Visual Studio throws the following error:

“The following tenants were not added to the account” Error Code: AADSTS70019

Environment Details

  • OS: Windows 10
  • Application: Visual Studio 2017 and Visual Studio 2019
  • MFA Method: Microsoft Authenticator (push + OTP)
  • Device: OnePlus mobile device (new device recently configured)

We have already performed the following steps:

  • Disabled and re-enabled MFA for the user
  • Reset user password
  • Required MFA re-registration
  • Revoked all user sessions
  • Reinstalled Microsoft Authenticator on mobile
    • Ensured notifications, background activity, and battery settings are correctly configured
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-04-14T11:04:24.4166667+00:00

    Based on the symptoms and the provided context, this is primarily a Conditional Access/MFA + multi‑tenant sign‑in issue in Visual Studio rather than a generic MFA failure (since MFA works for other Microsoft 365 apps).

    Use the following steps focused on Visual Studio’s multi‑tenant/MFA behavior and the Entra account state.

    1. Clear Visual Studio’s local identity cache
      • Close all instances of Visual Studio.
      • If any Access to the path 'C:\Users\<UserName>\AppData\Local\.IdentityService\…' is denied errors have appeared, delete the file or directory mentioned in the error under:
        • C:\Users\<UserName>\AppData\Local\.IdentityService\
      • Before deleting, verify file permissions and ensure the signed‑in Windows user has full control.
      • Reopen Visual Studio and retry sign‑in.
    2. Temporarily filter tenants in Visual Studio (bypass problematic guest tenants) AADSTS70019 and “The following tenants were not added to the account” indicate problems with one or more associated Microsoft Entra tenants. In Visual Studio (2017/2019):
      1. Sign out of the affected account in Visual Studio.
      2. Go to Tools > Options > Accounts.
      3. Uncheck Authenticate across all Azure Active Directories.
      4. Sign in again with the same account.
      Expected effect:
      • Visual Studio puts the account into a filtered state.
      • Only the default (home) tenant and its resources are available.
      • Problematic guest tenants are excluded, which often removes the AADSTS70019 error path and stabilizes MFA.
      If Visual Studio prompts to Re‑enter your credentials and shows specific directories/tenants with AADSTS errors, deselect the problematic tenants and continue with only the home tenant and any tenants that successfully reauthenticate.
    3. Complete MFA in the system browser and keep it open
      • When Visual Studio redirects to the system browser and triggers MFA, complete the flow there and keep the browser window open until all CA/MFA policies are validated.
      • Closing the browser too early can cause Visual Studio to lose the MFA state and re‑prompt or fail sign‑in.
    4. Validate the MFA method behavior on the device Since MFA works for other Microsoft 365 apps, focus on how the notification/OTP is being used:
      • For push notifications:
        • Ensure the user opens Microsoft Authenticator and checks the pending sign‑in request list. For anomalous or unfamiliar sign‑ins, notifications may not pop; the user must open the app and pull to refresh, then approve the request.
      • For OTP (verification code):
        • Confirm the user is entering the correct account’s code in Authenticator (multiple accounts can exist in the app). Each account has a unique OATH code.
        • Ensure the code is entered immediately (codes rotate every 30 seconds). “Invalid/incorrect” often indicates an expired code or wrong account.
    5. Reauthenticate with tenant selection in Visual Studio
      • When Visual Studio shows an account with a “Re-enter your credentials” banner:
        • Select Re-enter your credentials.
        • In the dialog that lists directories/tenants and AADSTS error codes, deselect any tenant that repeatedly fails.
        • Continue sign‑in with the home tenant and any working guest tenants.
      • Deselected tenants remain inaccessible until the account filter is removed, but this isolates the failing tenant from Visual Studio sign‑in.
    6. If issues persist
      • Capture the exact AADSTS70019 details from the Re-enter your credentials dialog (which tenant(s) fail) and open a Report a Problem / Developer Community ticket from Visual Studio, including:
        • Screenshot of the error and tenant list.
        • Description of which tenants are required for development.
      • This helps investigate tenant‑specific CA/MFA policies that may behave differently for Visual Studio than for standard Microsoft 365 apps.

    Summary of key actions for this scenario

    • Clear .IdentityService cache if any access issues occurred.
    • Disable “Authenticate across all Azure Active Directories” and sign in again so only the home tenant is used.
    • Use the Re-enter your credentials dialog to deselect failing tenants.
    • Complete MFA in the system browser and keep it open until finished.
    • Ensure the correct Authenticator account and fresh OTP are used when prompted.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.