1

I want to use this API as a Web module in Azure Data Factory [https://learn.microsoft.com/en-us/rest/api/datafactory/pipelineruns/querybyfactory

But it required me to get a bearer Token first in Authorization. enter image description here

I'm try to set up a token request first in this link but no help. Any guidance is appreciated https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc

Tony Anderson
  • 29
  • 1
  • 9

1 Answers1

1

No need to use the bearer token manually, you can use the MSI Authentication in your screenshot directly.

Navigate to your subscription or ADFv2 in the portal -> Access control (IAM) -> Add -> Add role assignment -> search for the name of your ADFv2 and add it as an Owner/Contributor role in the subscription. Then the MSI of your ADFv2 will be able to call the rest api.

enter image description here

Update:

Add the MSI like below, for exampple, my ADFv2 named joyfactory, just add the MSI with the same name as an Owner or Contributor.

enter image description here

After adding it, check it in the Role assignments , it should be like below.

enter image description here

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
  • @TonyAnderson Have you added the MSI as Owner or Contributor role? And what this `I loggin to ADFv2 using the same ID, password that I used to created it ` mean? – Joy Wang Oct 10 '19 at 07:54
  • @TonyAnderson No, it is not correct. You need to add the [MSI](https://learn.microsoft.com/en-us/azure/data-factory/data-factory-service-identity) of your ADFv2, not your user account. Just click the Add role assignment, search for your ADFv2 name, in your case, it is `VTA-ADF-dev`, then add it as Owner or Contributor. – Joy Wang Oct 10 '19 at 08:20
  • @TonyAnderson It looks like the result has been returned, `"vaule" : []`, there is no result via your query. – Joy Wang Oct 10 '19 at 08:48