How to use Visual Studio to Deploy Azure API Management for Azure Function App using Function Key instead of Anonymouse?

Siegfried Heintze 1,906 Reputation points
2022-10-22T19:30:54.247+00:00

I was able to create an Azure Function App in the portal with function key (instead of anonymous mode) and register that with a newly created Azure API Management and successfully test my function app using the nice test feature in the API Management in the portal.azure.com... Yahoo!

Then I discovered this youtube video: Deploy OpenAPI enabled Azure Functions with .NET in Visual Studio | Azure Friday . When I followed along with Justin Yoo and used anonymous mode it (the test with the API Management in the portal) it worked!

Is anonymous mode a good idea for a public Function App in production that reads and writes to a database? I'm thinking no.

So I want to use a function key for the Azure Function App and when I follow along with Scott Hanselman & Justin Yoo and create a function app with a function key (instead of anonymous mode) in Visual Studio and deploy the function App & the API management to Azure, I get access denied when I try to test it using that nice web UI inside API Management inside the portal.

I tried editing the function registration inside the API management to include the function key but no luck....

Can someone please guide me on how to use Visual Studio to deploy an API Management with a Function App using a function key ?

Thanks

Siegfried

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-10-26T05:14:30.323+00:00

    @Siegfried Heintze Thanks for reaching out. The same is documented here. When you try to create the Function project make sure to choose the Authorization level as Function as in step 4 discussed here. You need to make sure that your function first supports the Authorization level as Function rather than Anonymous. Now you need to redeploy your function app again and follow the same steps again as documented or mentioned in the video.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.