Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

How to connect the external tenant user to connect with Azure portal app?

Posted on by 16
I have registered an application in the Azure portal by selecting the option 'Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)'. Also added an external tenant user.
When I tried to use the app's client ID, tenant ID, and secret key with the external user's login, I got redirected to the call-back method and was able to generate an access token based on the app's client ID, tenant ID, and secret key with the authorized code (which I got from callback).
When I tried to get the company details using the access token with the app's tenant ID, I got an unauthorized error in Postman.
 
Is the above flow correct or not?
Using the app's tenant ID to generate an access token is valid or not and how to get the external user's tenant ID or how to generate an access token for the external tenant?
Also how to get the environment name for the tenant user and company details?
Because in APIs, I have to add the environment name, tenant ID, and company ID.
 
Which tenant_id do I have to use and if it is for an external user then how to get it?
How to get the environment name for the external tenant user?
How to get company details for an external tenant user?
 
***Note***
For the same tenant, I used the app's tenant ID and was able to get company_ID from the API response and also able to get Sales orders. The environment name I got from the Admin Center from Dynamics 365 Business Central. But for trial users where should I get this?

How to connect the external tenant user to connect with Azure portal app using the portal user's client ID, and client secret?
 
API:
https:/api.businesscentral.dynamics.com/v2.0/{{tenant_Id}}/Production/api/v2.0/companies({{company_Id}})/salesOrders
Categories:
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 12,167 Most Valuable Professional on at
    How to connect the external tenant user to connect with Azure portal app?
    Hi
    I hope this can help you, and give you some hints
    Task 2: Set up the Microsoft Entra application in Business Central  Using Service to Service Authentication - Business Central | Microsoft Learn 
    Best regards
    Gerardo
  • Community member Profile Picture
    Community member 16 on at
    How to connect the external tenant user to connect with Azure portal app?

    Hi Nitin Verma,
    Thanks for your reply. But could you clarify the below things


    Are you saying that I need to include the app ID's inside Business Central?

    But is the Microsoft Entra app in the admin center?

    Why cannot I see this in the trial account?

  • Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    How to connect the external tenant user to connect with Azure portal app?
    Hi,
     
    Have you provided the consent with the same App id in Business central using below image and set the permission?
     
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans