How can I create a new azure function in Azure portal without getting the error: "Error while loading - Error retrieving function"?

jo Eber 20 Reputation points
2024-12-03T12:50:39.8733333+00:00

I created a new python Azure function app, which is up and running. (Using the Consumption Plan)

When I try to create a new function in Azure portal, I can go through the configuration steps and get the notification, that the function was successfully created. Screenshot 2024-12-03 at 11.22.12

After the function is the opened in the Code+Test tab, I get an Error: Error while loading - Error retrieving function. When I exit out of the function, it is not listed in the function app. There is no function available again.

I have another function app running with the exact same configuration. It works like a charm.

Any ideas how to solve that issue?Screenshot 2024-12-03 at 11.25.53Screenshot 2024-12-03 at 11.26.33

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

Answer accepted by question author
  1. Ryan Hill 30,326 Reputation points Microsoft Employee Moderator
    2025-01-06T14:30:19.8866667+00:00

    Hey @jo Eber

    Thanks for connecting with me offline a couple weeks back. We determined the root cause was a compiler error related to app = func.FunctionApp(auth_level=func.AuthLevel.ANONYMOUS). The auth_level isn't a valid parameter for FunctionApp class. Updating that line from auth_level to http_auth_level corrected the issue. While auth_level is a valid argument for @app.route decorator, I checked the docs and didn't see any examples where app is instantiated with auth_level, but just in case I overlooked it, please share where you saw that, and I'll make sure the doc/learn module gets updated.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2024-12-04T02:07:23.5733333+00:00

    Hi jo Eber,

    Welcome to the Microsoft Q&A Platform! Thank you for reaching out regarding your query on creating a new azure function in Azure portal without getting an error.

    Please refer the below document for common runtime issues after deployment.

    common runtime issues after deployment

    If you woule like to check if the function exists at the backend, use Azure Cli and run the below command:

    az functionapp function list --name <FunctionAppName> --resource-group <ResourceGroupName>
    

    Delete the problematic function and recreate it using a different method:

    • Use VS Code with the Azure Functions extension.
    • Deploy the function using Azure CLI or ARM templates instead of the portal.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

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