Failed deployments from GitHub to Azure: "Request failed with status code: 401"

3.3k views Asked by At

I have a website set up on Azure that is automatically deploying changes from GitHub. This was working for a while, but now all my deployments are failing. If I look at the log, it just says:

Fetching Changes: Request failed with status code: 401

I had recently changed the repository from public to private. That's the only thing I can think of that would have caused a problem. But I reset my deployment credentials with my username/password on GitHub to make sure.

Any idea what could cause this error?

1

There are 1 answers

2
astaykov On BEST ANSWER

Break the CD (Continuous Deployment) link from your Web App to GitHub and re-create it:

enter image description here

The error you see is 401 Authorization required. Which is caused by changing your repo from public to private, thus invalidating all OAuth tokens and grants. Changing a repo type might seem like a small, but is substantial change, which invalidates all grants.

Your Azure Web App deployment credentials has nothing to do with your GitHub integration.

All source control integrations from Azure Web App to version control systems (i.e. GitHub, VSO, BitBucket, CodePlex, etc.) go via OAuth.