azure-functionsazure-management-api

Restart an azure function app which is not under Azure AD security


I was trying to restart that application by using

https://management.azure.com/subscriptions/{subscription}/resourceGroups/{rGp}/providers/Microsoft.Web/sites/{appName}/restart?api-version=2019-08-01

thing is it was giving me unauthorized status.

Keep that in mind .. that that application is not under Azure AD. Mostly the articles, I read about that issue are using Azure AD.

Question No 1: is it a necessity to add that azure function app in Azure AD?

Question No 2 : i tried that link enter image description here I have no idea how that is getting token for this but a token is added in header of that request. So how can i get that token? (my personal theory about that is that Microsoft is using my organization user to get that token. )

Question No 3 : even that above link and experiment yielded 200K but still activity log of that function app is not showing log of that retart activity . So what that means if that is giving me 200K that means app got restart or not ?


Solution

  • We have did repro in our local environment below are the analysis based on the repro findings.

    Question No 1: is it a necessity to add that azure function app in Azure AD?

    Question No 2 : i tried that link have no idea how that is getting token for this but a token is added in header of that request. So how can i get that token? (my personal theory about that is that Microsoft is using my organization user to get that token. )

    Question No 3 : even that above link and experiment yielded 200K but still activity log of that function app is not showing log of that restart activity.So what that means if that is giving me 200K that means app got restart or not ?

    enter image description here