Azure Function with AD auth results in 401 Unauthorized when using Bearer tokens

前端 未结 7 565
春和景丽
春和景丽 2020-12-29 07:47

I have a very simple Azure function in C# for which I\'ve setup Azure AD Auth. I\'ve just used the Express settings to create an App registration in the Function configurati

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 08:06

    I managed to get it working through postman using following configuration. Important lesson was setting in "Allowed token audiences" and "resource" name used in postman to acquire token should be same in this case. I used the same code provided here in question. in this case app registered in Azure AD is a client and resource as well. configuration and testing through postman as follows

    Acquire token in postman

    Calling azure function using Postman .. Authorization header with bearer token

提交回复
热议问题