Forum Discussion

bri992's avatar
bri992
Copper Contributor
Sep 06, 2020

Best way to secure Azure Function

So far, I am able to create azure functions that are accessible anonymously. However I'd like to secure those functions so that they only run from a specific Microsoft Flow. I am reading the docs and watching videos and am kinda lost on how to secure azure functions. What I did was I went to my function app, to Authentication / Authorization, and set the "App Service Authentication" to "On". I chose Log in with Azure Active Directory, and choose Advanced. In the client ID, I pasted the client ID that's added in app registrations. However I left the "issuer url" and "Allowed Token Audiences" empty as the docs aren't really clear on what these values should be. However when trying to execute the Azure function this way, am getting "id_token" is not enabled for your app. So I went to my app registration, and clicked on "Token configuration" from the left menu, I clicked on "Add optional claim" and chose ID and checked all the claims, and hit Add. But that didn't solve the issue. Is there a clear documentation of what should be done exactly? A lot of talking in the docs about theories and how authentication works but nothing practical to actually teach people to secure their functions step by step. 

Share

Resources