azureazure-web-app-service

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.


Solution

  • 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.

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here