1
votes

I'm working on Azure Cosmos DB Feed changer Function. My requirement is in the feed changer function I need to access Web API using AAD authentication.

How should I configure the connection between the Azure Function and Web API using AAD so that the azure function can send the change feed to Web API? How can I call the Web API in the function code?

Thank You, Dheeraj

1

1 Answers

0
votes

Based on your requirements, I suggest you using MSI(Managed Service Identity) in your azure function app.

You could create an identity here.

enter image description here

Then search the identity in AAD Enterprise Application list,you could find the permissions of it.

enter image description here

Then please refer to this document to obtain the access token and call your web api which is using AAD authentication with that token.

In addition, you could store the secret in Azure Key Vault and get the access token from AKV to call your web api. It support you to manage multiply permissions.

More details ,please refer to this link:https://blogs.msdn.microsoft.com/benjaminperkins/2018/06/13/using-managed-service-identity-msi-with-and-azure-app-service-or-an-azure-function/