Function App deployment stuck with BadGateway error on Microsoft.Web/serverfarms resource

Zaeem Khaliq 20 Reputation points
2025-05-18T21:09:15.1466667+00:00

I have tried deploying Function App with various configurations:

  • Consumption and Flex Consumption hosting option.
  • Tried in two different regions (West US 2 and East US).
  • With Basic Authentication enabled as well as disabled.
  • Secrets as well as Managed Identity for storage account authentication.

And rest of the configuration as following:

  • Runtime stack: Node.js
  • Version: 22
  • Instance Size: 2048MB
  • Storage Account: Existing
  • Enable public access: On
  • Enable virtual network integration: Off
  • Enable Application Insights: Yes
  • Continuous deployment: Disable

But every time after deployment is initialized, the resource type Microsoft.Web/serverfarms immediately shows BadGateway error, upon clicking on its Operation Details link, it shows the following error message:

The subscription '2725a2e3-41a2-4efc-8c98-5e97c1ce1696' is not allowed to create or update the serverfarm.

What could be the reason and how to solve this issue??

Note: I have Owner + Storage Blob Data Owner permission on storage account so it doesn't seems like an issue with storage account. User's image

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author
Sai Prabhu Naveen Parimi 3,970 Reputation points Microsoft External Staff Moderator
2025-05-21T06:17:50.0366667+00:00

@Zaeem Khaliq

Thank you for the update. I’m glad to hear that your Function App deployment is now working as expected.

Following our investigation with the internal Azure team, it was confirmed that the failure to create the Microsoft.Web/serverfarms resource was due to a backend restriction placed on your subscription. While your account had the appropriate Owner or Administrator permissions, the issue was caused by an automated protection mechanism in the Azure App Service platform.

As part of ongoing efforts to safeguard Azure services, the platform continuously monitors subscription activity to detect behavior that may appear fraudulent or malicious. This system uses several criteria—such as the rate of resource creation and the age of the subscription—and is designed not to interfere with normal operations.

However, in this instance, there was an error in the detection algorithm resulting in the detection of valid operations within your subscription. This led to a temporary block on App Service Plan creation and update operations.

Our team has since taken steps to unblock these operations for your subscription. You should now be able to proceed with deployments without any further issues.

We are also taking broader corrective actions to prevent such issues in the future, including continued refinement of our detection algorithms to ensure that valid, non-fraudulent activity is not impacted.

We sincerely apologize for any inconvenience this may have caused and appreciate your understanding.

Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

User's image

If you have any other questions, let me know in the "comments" and I would be happy to help you.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.