Azure Function Timer Trigger statusCode 413 request entity too large

KGrice 26 Reputation points
2021-08-31T19:26:55.32+00:00

Hello,

I am trying to get Azure functions set up with timer triggers to run Python scripts. The full script makes an API call, parses the returned JSON, and loads the results to an Azure SQL database table. Credentials are kept in Azure Key Vault secrets. All of this works locally, but I haven't even been able to get a very pared down example to work as an Azure function. This basic example gets secrets from Key Vault and uses those as credentials to create an empty table in the Azure SQL DB. All of this also works locally.

Once deployed to my Function App, I'm going into the function and doing the Test/Run under Code + Test. This connects to Application Insights, but the HTTP Response returns statusCode 413, request entity too large. If it matters, I was getting statusCode 500 before I switched my DefaultAzureCredential to a ManagedIdentityCredential. After what I'm assuming is a successful change to ManagedIdentityCredential (including granting access to the Key Vault and SQL DB), I'm now getting statusCode 413.

I don't understand what the function is doing well enough to know how to address this. Am I actually requesting anything? What request would be too large in this kind of setup? The table I'm creating is a one-column table with no rows, which I'm using so I can confirm getting the basic setup down before adding my intended functionality as detailed above.

I also haven't figured out how to get more detailed error information if that's available. Is it possible to see more than just the basic HTTP response content? Can I find out what specifically is triggering that code?

Finally, the purpose of this is just to run my Python script in the cloud so it's not dependent on my local machine. Running it in an Azure Function with a timer trigger seemed the best approach, but I started getting lost in all the options. Does this approach make sense?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,520 questions
{count} vote

Accepted answer
  1. Jayme Gordon 81 Reputation points
    2021-09-04T17:56:02.437+00:00

    @KGrice not sure if this will solve your issue, but I just got the same "413 request entity too large" after setting up a new function app, and what fixed it for me was to add:

    https://functions.azure.com

    to your CORS allowed domains.

    I only tried this because a few weeks ago I got a similar error after creating a new function app, and this fixed that, so just tried again and it seemed to work.

    Again no idea if this is related to your issue or not.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful