I’m trying to get a OATH token for the ADF managed identity to query Azure Storage APIs, this is the Web Activity I’m using
{
"name": "Get Bearer Token",
"type": "WebActivity",
"dependsOn": [],
"policy": {
"timeout": "0.1:00:00",
"retry": 1,
"retryIntervalInSeconds": 30,
"secureOutput": true,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"url": {
"value": "https://login.microsoftonline.com/@{pipeline().globalParameters.TenantId}/oauth2/v2.0/token",
"type": "Expression"
},
"body": {
"value": "concat(n 'grant_type=client_credentials'n ,'&scope=https://storage.azure.com/.default'n ,'&client_id='@{variables('adf_principal_id')}'n)",
"type": "Expression"
}
}
}
The body is this – so it’s more clear
concat(
'grant_type=client_credentials'
,'&scope=https://storage.azure.com/.default'
,'&client_id='@{variables('adf_principal_id')}'
)
I’m getting this error
The request body must contain the following parameter: ‘grant_type’
What is the grant_type
for a managed identity?
How do I fix this?