Is there any way to trigger a manual azure web job using OAuth 2.0 token generated using app service authentication?

31 Views Asked by At

I have set up authentication for my app service and I am trying to call my web job using the webhook url. I want to pass the OAuth token rather than basic auth. Is there any way to do this?

I have tried sending the token in the web hook call in postman but it gives me 403 forbidden error.

1

There are 1 best solutions below

0
Joaquín Vano On

example to get token

az login # using MSI or SP that has RBAC Contributor access TOKEN=$(az account get-access-token --query accessToken | tr -d '"')

example call to invoke a webjob

curl -XPOST -H "Authorization: Bearer $TOKEN" https://.scm.azurewebsites.net/api/trigeredwebjobs//run