question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az functionapp create gives 400 Bad Request error

See original GitHub issue

Describe the bug Upon attempting to create a function app based on the syntax in the documentation, I receive an error message: “There was a conflict. The remote server returned an error: (400) Bad Request.”

To Reproduce

  • az functionapp create --name {} --resource-group {} --runtime {} --storage-account {} --plan {}
  • az functionapp create --name {} --resource-group {} --runtime {} --storage-account {} --consumption-plan-location {}

I have tried this both by specifying a plan and by specifying a consumption plan location - both have the same issue.

Expected behavior A function app should be created.

Environment summary Windows-10-10.0.18362-SP0 Python 3.6.6 Installer: MSI

azure-cli 2.9.1

Additional context The debug output includes a WEBSITE_CONTENTSHARE property in the HTTP PUT request that fails, and I found this bug report while searching for a resolution or workaround: https://github.com/Azure/azure-functions-templates/issues/952

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
skoladichcommented, Jul 28, 2020

I found the bug! I was specifying the --storage-account argument with capital letters (i.e. StorageAccount instead of storageaccount), and the storage accounts API returned the account information anyways, but the account name with capital letters was used to generate the connection strings in the AzureWebJobsStorage and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING app settings, and the web site API returned an HTTP 400. It works fine with the account in all lowercase (technically the correct name.)

Debug log is attached: az-functionapp-create-debug.log

0reactions
RakeshMohanMSFTcommented, Aug 4, 2022

Closing this thread

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug in Function App naming causing deployment error on the ...
"There was a conflict. The remote server returned an error: (400) Bad Request.". I understand that the limit is maximum 59 characters.
Read more >
(400) Bad Request when deploying a Function App via ARM
Error: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' application setting is missing from your app. This setting contains a connection string for an ...
Read more >
Azure App service 400 Bad request! — A STORY | by Roopa V R
So, whats HTTP status Code 400 Bad Request ? the 4XX errors signify that the Client seemed to have Erred. 400 in particular...
Read more >
azure api management 400 bad request
An in-depth guide into a 400 Bad Request Error - what it is, what are its causes and how you can solve this...
Read more >
All of a sudden getting 400 Bad Request responses ... - Reddit
I've been wrangling weird issues deploying function app code to app services recently ... it's always something it seems. I love Azure, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found