How to protect an Azure Function with AAD

The following steps describe how to protect an Azure Function with AAD (Azure Active Directory).

Step 1: Add identity provider

Navigate to your Azure Function and then the Authentication blade. Click Add identity provider.

Add identity provider for an Azure Function

Step 2: Identity provider settings

  • Select Microsoft as the identity provider
  • Enter any name for your application registration for AAD (you can leave it as the default of your Azure Function name)
  • Change Unauthenticated requests to HTTP 401

Identity provider settings

Step 3: Verify Azure Function secured

Call any of your functions on your newly secured Azure Function. You should receive a 401.

401 Azure Function

If you want to securing call this Azure Function, see the following related entries:

About the author

For the past two decades, Scott McCulloch has worked with a variety of distributed computing technologies. He is currently focused on cloud-native applications.