Reputation: 11
I am working on a logic app which needs to get data from Dynamics F&O. I am using Get action for Dynamics F&O but I cannot use Sign in method or Service Principal due to some reason. I rather store my service principal Client ID and Secret in an API Connection which is in my Logic App.
My question is, how should I connect to using that API Connection which has Client ID and secret for my service principal or should I have to use some other task to achieve this or get data from Dynamics F&O
Upvotes: 1
Views: 658
Reputation: 1731
You can use the API Connection that you created to connect to Dynamics F&O. To authenticate with the API Connection, you can use the HTTP
action in your Logic App. Here are the steps to do so:
HTTP
action to your Logic App.HTTP
action, set the Method
to POST
.URI
to https://login.microsoftonline.com/{tenant-id}/oauth2/token
, where {tenant-id}
is the ID of your Azure AD tenant.Headers
section, add the following key-value pairs:Content-Type
: application/x-www-form-urlencoded
Authentication type
: Active Directory OAuth
Then in you can connect to Dynamic F&0 get records action by providing connection name, client id, client secret and tenant details as taken in http action.
As mentioned in this @ AMREEK SINGH blog after http action you can also use parse Json action.
In the Parse JSON
action, set the Content
to the output of the HTTP
action. Then you can take Get records action of F&O.
Refer this SO and MS document it may helps.
Upvotes: 1