Azure / Azure/static-web-apps

Azure ARM deployment fails when GitHub repo has branch protection rules

Open
#241 2 comments 0 reactions 0 assignees View on GitHub
github-action IaaC
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

## Issue
I had a GitHub branch that had a protection rule not allowing direct commits. I attempted to deploy a Static Web App that connects to that branch and received this vague error message when deploying:

![ARMError](https://user-images.githubusercontent.com/54363786/102123200-7c835700-3dfb-11eb-99f7-0d32d21d1336.jpg)

With the error message:

```
{
"status": "Failed",
"error": {
"code": "InternalServerError",
"message": "There was an unexpected InternalServerError. Please try again later. x-ms-correlation-request-id: e1aa095e-368c-4e79-9a8a-dacc435580dd"
}
}
```

Upon removing the branch protection policy the static web app deployed successfully.

## Proposed Solution

I propose either of the following when a branch protection policy is present:

- An error message is raised when first selecting that branch that states a branch protection policy is present and you need to remove it.
- When you deploy, instead of directly committing you are given the option to open a PR from a new branch with the workflow
- You are given the option to deploy without a workflow file and go commit/PR your own.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.