What are the API Permissions necessary to start Azure Data Factory pipeline?

Viewed 1356

I would need to start an Azure Data Factory pipeline from REST API as per https://docs.microsoft.com/en-us/rest/api/datafactory/pipelines/createrun#code-try-0

I have created an AAD app, and given it the Azure Service Management API Permission. However when the client through the OAuth2 Implicit flow receives an id_token and invokes that API to start a pipeline I get

{
    "error": {
        "code": "InvalidAuthenticationToken",
        "message": "The access token is invalid."
    }
}

Am i using proper API pemrission? thanks.

2 Answers

If you just want to use OAuth2 flow to get the token to call the REST API, the client credentials flow is more suitable than the Implicit flow in this case.

Please follow the steps below.

1.Get values for signing in and create a new application secret.

2.Navigate to the data factory -> Access control (IAM) -> Add -> add your AD App as an RBAC role e.g. Contributor, Owner, Data Factory Contributor, details follow this.

3.In the postman, follow the screenshot below, fix the request body got from step 1, then use the token to call REST API, it will work fine.

POST https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token

client_id=<client_id>
&scope=https://management.azure.com/.default
&client_secret=<client_secret>
&grant_type=client_credentials

enter image description here

Related