puri
puri

Reputation: 1849

How to consume Azure Function App from Azure Logic App running locally in VS Code?

We have an existing Function App deployed to Azure and secured with Azure AD authentication. The functions are set to anonymous access as a result, so one cannot use a function key to authenticate.

We can successfully deploy Logic App and connect to Function App via Managed Service Identity.

But while building and running a Logic App in VS Code, how can we authenticate and make calls to this deployed Function App from local development machine?

Upvotes: 2

Views: 353

Answers (1)

Skin
Skin

Reputation: 11197

I’m going to add this as answer although I haven’t delved into it completely for your scenario. I have used this approach before for other scenarios relating to functions but not via LogicApps. I can’t see why it wouldn’t be an issue though.

So on that, you should look into the standard Azure Identity framework for VSCode/Visual Studio.

https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme

This is straight from the documentation …

Developers using Visual Studio Code can use the Azure Account extension to authenticate via the editor. Applications using the DefaultAzureCredential or the VisualStudioCodeCredential can then use this account to authenticate calls in their application when running locally. To authenticate in Visual Studio Code, ensure version 0.9.11 or earlier of the Azure Account extension is installed. To track progress toward supporting newer extension versions, see this GitHub issue. Once installed, open the Command Palette and run the Azure: Sign In command.

Theoretically, if the user you have logged into the VSCode extension with has access to run the function then I’d expect it to work.

Upvotes: 2

Related Questions