Skip to main content

Notifications

Announcements

No record found.

Business Central forum
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
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 8,784 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 20,995 Moderator 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?
     
     
     
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,326 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,166 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans