I manually published the Azure Function code via Visual Studio 2022.
My next task is to create a console application responsible for creating an Azure Function directly on Azure and hosting the published code. Essentially, I want to replicate the same process as clicking the "Publish" button in Visual Studio for Azure, but I’d like to achieve this through C# code.
This is the objective I’m currently working on.
2
Answers
Below is end to end code that works for me.
Follow below steps to create function app via console application:
Open
Active Directory=> App Registrations=>create new Registration=> Register a new application
.Go to
overview
of the newly registered app => copy theclient id & Tenant id
And Navigate to Certificates & Secrets, create a new secret and copy the secret value, it’ll be used as client_secret.
Try below code to create an Azure function App via console application: