Account not recognized when publishing from Visual Studio 2022 to Azure

Patrick Lam 20 Reputation points
2024-07-17T14:07:09.56+00:00

When publishing web page from Visual Studio 2022 to Azure, the account was not recognized and the following message appeared:

"AADSTS50020: User account 'xxxxxx' from identity provider 'live.com' does not exist in tenant 'Microsoft Learn Sandbox' and cannot access the application '........'(Visual Studio) 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."

I am new to Azure and would much appreciate advice on how to do the above. What does 'tenant' refer to in the above and why is 'Microsoft Learn Sandbox' involved?

Thanks

Patrick

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
886 questions
{count} votes

Accepted answer
  1. ajkuma 25,546 Reputation points Microsoft Employee
    2024-07-19T18:29:21.4833333+00:00

    Patrick Lam, Firstly, apologies for the delayed response.

    Typically the error message you’re seeing, AADSTS50020, indicates that the user account you’re trying to use does not exist in the specified tenant.

    Based on my understanding of your issue description, you are provisioning Azure Static WebApp ( or Azure App Service) via Visual Studio but receiving an error.

    Just to clarify, a tenant is essentially a dedicated instance of Azure Active Directory (AAD)/Microsoft Entra that an organization receives when it signs up for a Microsoft cloud service (such as Azure, Microsoft 365, or Dynamics 365. )Each tenant is distinct and separate from other tenants.

    Microsoft Learn Sandbox: This is a temporary environment provided by Microsoft Learn for hands-on training and experimentation. It is isolated from your organization's Azure environment. MS Learn FAQ.
    So, it looks like you maybe using an account that was associated with Microsoft Learn Sandbox that was used for practicing training modules.

    Kindly try the following steps to isolate the issue:

    -If you haven't done, Sign out of Visual Studio and sign in again with your personal account which you had used to sign -up for Azure.

    -On Azure Portal > On your profile (you can see the identity you’re using in the upper right-hand side of your Azure portal) >> select Switch directory

    You may change the directory by selecting the 'Directories + Subscriptions' filter button on the toolbar along the top. As you mentioned you have 3 directories, you may simply switch to your personal account subscription/directory ( set it as default + mark as favorite )

     
    For deleting the other directories, please checkout the conditions for deleting

    Can't delete a directory through the Azure Management Portal
    Discuss thread (How to remove directory) steps by my college.

    User's image

    Reference:

    Kindly let us know how it goes, I'll follow-up with you further.


    If the answer helped (pointed, you in the right direction) > please click Accept Answer to benefit the community find answers quickly to similar question.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Patrick Lam 20 Reputation points
    2024-07-22T07:47:11.7733333+00:00

    Sorry for taking so long to respond. I was trying to remove the two directories by asking the two companies. One of them deleted when I asked them. The other one is still in the process getting Microsoft Support to help. I am also going through the other recommendations. Thanks for helping and I will revert quickly. Patrick


  2. Patrick Lam 20 Reputation points
    2024-08-05T14:10:12.0633333+00:00

    ACCEPTED ANSWERS

    Thanks for the replies. Microsoft Support found that I am the only global admin for the account. As such, I am the only one to delete the subscription and the account with the company as directory tenant. This was done and the account was deleted. I have subsequently subscribed for a personal account using my same personal email.

    The data for the deleted account will be deleted in 90 days. Microsoft Support is monitoring the deletion. Thanks again for the suggestions.

    Patrick


Your answer

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