Is it possible to add custom authentication on python based azure function

Yugesh KC 21 Reputation points
2023-01-09T07:13:30.913+00:00

I have developed API using python based azure function. I have come across a situation where I have to implement custom JWT authentication and authorization middleware to the API.

  • The only possible option I have found so far is to use application level python worker extension THIS

Questions:
2. Is it possible to use application level python worker extension for authentication and authorization
3. Is there another alternative way to implement authentication and authorization to python based azure function

Note:

  • function app in isolation and azure API management due to associated cost.
  • Easy auth is also not appropriate
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. MughundhanRaveendran-MSFT 12,506 Reputation points
    2023-01-18T10:44:21.4366667+00:00

    Hi @Yugesh KC ,

    Since you are not interested in Easy auth. You will have to create python worker extension and implement the custom JWT authentication and authorization.

    Please refer to the below documents for reference, I cant find any specific documentation related to authentication though.

    https://learn.microsoft.com/en-us/azure/azure-functions/develop-python-worker-extensions?tabs=linux%2Cpypi

    https://github.com/Azure-Samples/python-worker-extension-timer

    Hope this helps! Feel free to reach out to me if you have any queries or concerns.


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.