Share via

Urgent: Unable to Run and Debug Teams App Locally – AADSTS50020 / Custom App Upload Check Failed

Pranit 0 Reputation points
2025-09-05T02:24:42.1933333+00:00

I am blocked from testing my Teams app in the actual Teams client (critical go-live issue). The app works when run in the Microsoft 365 Developer Playground (VS Code → “Run and Debug in Microsoft 365”), but many features like Salesforce live notifications don’t execute there, so I need it to run inside Teams with my enterprise account.


Environment:

  • VS Code with Microsoft 365 Agents Toolkit extension
  • App pre-provisioned successfully
  • Running fine locally in Playground

Issues Encountered:

1) When running/debugging with enterprise account A:

AADSTS50020: User account '*****@gptfy.dev' from identity provider* 'https://sts.windows.net/fe4efb0a-b7e1-47a5-aeee-d9d801cdc354/' does not exist in tenant 'Default Directory' and cannot access the application '5e3ce6c0-2b1f-4285-8d4b-75ee78787346'(Microsoft Teams Web Client) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.

2) When running/debugging with enterprise account B:

“You don’t have the required permissions to access this org. Talk to your IT admin for more info or switch to another account.”

IT admin has already gone into the backend and granted every possible permission to my account. Still no resolution.

3) When uploading app package manually (via Teams > Manage apps > Upload a custom app):

Error: “App not found”

4) In VS Code, under Microsoft 365 Agents Toolkit “Validate prerequisites”:

Error: "Custom App Upload Check Failed”

No documentation available for this error online.


Some of what I have tried:

  • Verified Node.js, ports, Microsoft 365 account sign-in (all good).
  • Pre-provisioning succeeds without errors.
  • Tested in Microsoft 365 Developer Playground → app runs, but critical Salesforce-linked features can’t be validated there.
  • Signed out/in multiple times with both accounts.
  • IT admin granted broad permissions (Teams admin, global admin, custom app upload permissions, etc.).
  • Tried uploading app package manually → fails with “App not found.”

This is a go-live critical blocker. Any guidance or escalation would be appreciated.

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

2 answers

Sort by: Most helpful
  1. Kudos-Ng 15,050 Reputation points Microsoft External Staff Moderator
    2025-09-05T06:30:49.4433333+00:00

    Hi Pranit

    Thank you for posting your question in the Microsoft Q&A forum.  

    From your description, it seems you're encountering critical blockers while trying to test your Teams app directly in the Teams client, particularly because key features like Salesforce live notifications don’t execute properly in the Microsoft 365 Developer Playground. To overcome this, you attempted to upload and test the app in Teams using your enterprise account, but ran into several issues. I’ve reviewed your case and done some research to provide a few insights that may help: 

    Issue 1: AADSTS50020 Error 

    This error typically occurs when the user account you're using belongs to a different Azure AD tenant than the one where the app is registered. Microsoft has a support article that explains this in detail. You may need to ensure that the account is added as a guest user in the correct tenant or switch to an account that belongs to the tenant where the app is registered. 

    Issue 2:You don’t have the required permissions to access this org. Talk to your IT admin for more info or switch to another account.” 

    Even though account B has been granted admin roles, this error may still occur due to network restrictions or conditional access policies. I found a related thread where users resolved this by switching networks—suggesting that internal firewalls or proxies might be interfering with access. 

    Issue 3: “App not found” when uploading manually 

    This could be related to issues in your manifest.json file. I recommend validating the schema and ensuring all required fields are correctly filled. You can also follow this Microsoft guide on uploading custom apps to ensure all prerequisites are met. 

    Issue 4: “Custom App Upload Check Failed” in VS Code 

    Unfortunately, I couldn't find any official article for this error at this time. However, I suggest asking your Teams admin to double-check the custom app upload settings in the Teams admin center. This article outlines the necessary policies and permissions. 

    Since this is a go-live critical blocker, I highly recommend raising a support ticket with Microsoft via your admin portal. Microsoft support agents have access to diagnostic tools that can provide deeper insights and help resolve tenant-specific issues more effectively. 

    I hope these insights help move things forward. Let me know if you have any further questions. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".      

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


  2. Nivedipa-MSFT 4,081 Reputation points Microsoft External Staff Moderator
    2025-09-05T04:54:37.83+00:00

    @Pranit -
    You’re hitting a combination of Azure AD tenant/account issues and Teams app upload policy/config problems. Here’s a step-by-step diagnosis and fix plan:

    1. AADSTS50020 error (account not in tenant)
    • This means your user (******@gptfy.dev) is not a member or guest in the Azure AD tenant where the Teams app is registered (tenant id: fe4efb0a-b7e1-47a5-aeee-d9d801cdc354).
    • Fix: Add your user as a guest (B2B) to that tenant, or use an account that is a member of the tenant.
      • IT admin: Go to Azure AD > Users > New guest user, invite ******@gptfy.dev, accept the invite, and retry.
    1. You don’t have the required permissions to access this org”
    • This means your account exists in the tenant, but is missing a required Teams or AAD permission, or Conditional Access is blocking you.
    • Fix:
      • Confirm your account is not disabled or blocked by Conditional Access.
        • Ensure you have at least Teams App Developer and Teams App Installer roles, and that custom app upload is enabled for your user/org.
          • IT admin: Teams Admin Center > Teams apps > Setup policies > ensure “Upload custom apps” is ON for your policy.
    1. “App not found” when uploading package
    • This usually means the app manifest is missing required fields, has an invalid ID, or the app is not allowed by org policy.
    • Fix:
      • Double-check manifest.json:
         - id is a valid GUID and matches the app registration.
        
               - packageName, version, and all required fields are present.
        
                     - webApplicationInfo is correct for SSO.
        
                        - Ensure the app is not blocked by Teams app permission policies (Teams Admin Center > Teams apps > Permission policies).
        
    1. “Custom App Upload Check Failed” in VS Code
    • This means the toolkit cannot verify that your account/tenant allows custom app uploads.
    • Fix:
      • In Teams Admin Center, confirm “Upload custom apps” is enabled for your user’s policy.
        • If you recently changed this, it can take up to 24 hours to propagate.
          • Try in a private browser window or after clearing Teams cache.
    1. General troubleshooting steps
    • Make sure you are using the same tenant for app registration, app upload, and user sign-in.
    • If you have multiple tenants, always check which tenant your Teams client is signed into (click your profile in Teams > Manage account).
    • If you’re using a Microsoft 365 Developer tenant, ensure it is active and not expired.
    • If you’re using a work account, confirm with IT that no Conditional Access or security policy is blocking custom app uploads or third-party apps.
    1. If all else fails
    • Try uploading the app in Teams web client (teams.microsoft.com) instead of desktop.
    • Create a new test user in the tenant, assign all required roles, and try with that user.
    • If you have access, check Azure AD sign-in logs for errors at the time of failure. Doc References:

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.