Hello @krishna572 Note that Azure Functions doesn't implement MVC pattern like ASP.NET Core does. If you meant to have both Azure Functions and ASP.NET Core projects under a same solution and leverage the Authentication/Authorization features in ASP.NET Core project (via a Controller) for your Azure Functions project, that won't be possible because projects under a solution in Visual Studio is only a logical grouping of related projects; they don't share same functionalities, dependencies among each other.
You can still use the same Authentication/Authorization features (of Microsoft.AspNetCore namespace) in Azure Functions though. Please refer to the following blog post: Microsoft.Identity.Web and Azure Functions
Here's an official sample: https://github.com/AzureAD/microsoft-identity-web/tree/master/tests/DevApps/AzureFunctions
Additionally, if you still need to run another ASP.NET Core app alongside Azure Functions app but also want a way to handle Authentication/Authorization for both of them from in a centralized manner, you might want to consider placing API Management in front of them:
- Use Azure API Management (APIM) to authenticate requests
- Protect an API in Azure API Management using OAuth 2.0 authorization with Azure Active Directory
I hope this helps, please let me know if you have any questions.