0

A third party service calls an Azure Function implemented by me and defined as a WebHook. Right now, this function retrieves a SQL connection string securely from Azure Key Vault, connects to the database and manipulates data directly.

However, I want the function to use my Azure App Service backends' controller methods just the way, the client does. The client (Xamarin.Forms iOS/Android) authenticates against the backend using Azure AD B2C and makes use of the MobileClient SDK from Microsoft for easy working with tables.

How can I make the Azure Function work with the Controller methods?

Mephisztoe
  • 3,276
  • 7
  • 34
  • 48

1 Answers1

1

If I understood your question, you just need to get a token from azure AD and send a request to your controller (passing the token in the header).

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • Could you point me to some resource that explains how to do what you suggested? atm, I am manipulating the database directly from the Azure Function. For this to work, I stored its connectionstring securely in Azure KeyVault and have my Function create a KeyVaultClient by utilizing the AzureServiceTokenProvider. But I cannot get it to retrieve an Access Token. – Mephisztoe Apr 01 '20 at 12:42
  • 1
    try with Managed Identity: https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad?toc=/azure/azure-functions/toc.json also take a look on this: https://stackoverflow.com/questions/53499971/azure-function-authentication-using-azure-active-directory – Thiago Custodio Apr 01 '20 at 13:41