Hi,
So I am using a Power Automate flow which send REST API HTTP post request to start/stop the stream analytics.
In first step, I am fetching the bearer token sucessfully for which I have created an app and did app registeration in azure active directory. In Api permission, I have added azure service management (
user_impersonation) also microsoft graph was already had permission. Now I got client id and secret for this app which I have saved in Keyvault which i am using in flows.
In Expose an API, i have added name of the stream analytics as scope and gave admin & user rights consent.
In Stream analytics, http post is: https://management.azure.com/subscriptions/xxxfd2xx-xxxx-xxxx-xxxx-668dbxxxxxx3xx/resourcegroups/TEUXXXXT/providers/Microsoft.StreamAnalytics/streamingjobs/asa-xxx-dev/start?api-version=2020-03-01
where it takes authorization from bearer token which correct and content type is application/json while body is { "outputStartMode": "JobStartTime" }.
Now, the proces successfully fetch bearer token however, in stream analytics rest api post request it give this error
'The client 'xxxx4f8x-x2xx-x8xx-xx5x-xxx771a05xxx' with object id 'xxxx4f8x-x2xx-x8xx-xx5x-xxx771a05xxx' does not have authorization to perform action 'Microsoft.StreamAnalytics/streamingjobs/start/action' over scope '/subscriptions/xxxfd2xx-xxxx-xxxx-xxxx-68dbxxxxxx3xx/resourcegroups/TEUXXXXT/providers/Microsoft.StreamAnalytics/streamingjobs/asa-xxx-dev' or the scope is invalid. If access was recently granted, please refresh your credentials.'
How can I resolve this issue?
Thank you