Ha Bom
Ha Bom

Reputation: 2917

Repository 'UpdateSiteSourceControl' operation failed with Microsoft.Web.Hosting.SourceControls.OAuthException: GitHub Bad credentials

I'm having this error when trying to deploy an Azure Web App using Github repo.

{
    "status": "Failed",
    "error": {
        "code": "BadRequest",
        "message": "<Error xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><Code>BadRequest</Code><Message>Repository 'UpdateSiteSourceControl' operation failed with Microsoft.Web.Hosting.SourceControls.OAuthException: GitHub GetSecretsPublicKey: Bad credentials&#xD;\n   at Microsoft.Web.Hosting.SourceControls.GitHubProxy.&lt ...

I used the authorize button in the Deployment Center to link the Github account. I've tried to revoke the old access from Azure in Github and tried again but it's not working.

Upvotes: 0

Views: 3365

Answers (3)

k32y
k32y

Reputation: 427

I had a similar error.

I noticed in the error it says that deploy keys are disabled for this repository.

So I simply went to the GitHub organization settings for the repository, and enabled Deploy Keys.

After that everything works perfectly.

Upvotes: 0

AliAwwad
AliAwwad

Reputation: 379

For me, I got the same error. the solution was to wait for 15 minutes or so.

It is ok to get the error, just wait for some time and try to run the deployment again, it should work.

Upvotes: 1

Harshitha
Harshitha

Reputation: 7367

Repository 'UpdateSiteSourceControl' operation failed with Microsoft.Web.Hosting.SourceControls.OAuthException: GitHub Bad credentials

Initially even I got the same error.

enter image description here

This is because Azure App Service is not registered in Authorized OAuth Apps.

enter image description here

Follow the below steps to regsiter the Azure App Service.

  • First create an Azure App Service.
  • Navigate to GitHub => in Right hand pane select Settings => select Developer settings in the left hand pane => OAuth Apps => Register a new Application.

enter image description here

enter image description here

  • ClientID and Client Secret will be created, copy those for later use.
  • Navigate to the created Azure App Service => Authentication => Add Identity Provider => select GitHub and provide the ClientID and SecretID from GitHub.

enter image description here

  • In Azure App Service => Deployment center = >select source as GitHub and click on Change Account => Authorize AzureAppService.

enter image description here

  • Now you can see the Azure App Service in GitHub => Applications => Authorized OAuth Apps.

enter image description here

  • Now Iam able to Build Application with GitHub in Deployment center.

enter image description here

  • This settings has to be done only once.
  • From next deployment, you can simply select and build GitHub source without any issues.

Upvotes: 2

Related Questions