When I try to set up continuous deployment through GitHub Actions on an App Service (either a Asp.NET app or a Node app), I get a Failed to set up deployment: Cannot find SourceControlToken with name GitHub
error.
I’ve ensured Azure App Service is authorized on my account’s authorized OAuth Apps, but I haven’t found any further instructions on whether there are any settings I must change on Github’s side.
What I found here on SO was Deploying website from private Github repository using ARM Templates, that pointed me to check whether there’s a token set on /providers/Microsoft.Web/sourcecontrols/GitHub
resource, which there is (token obscured by me of course):
{
"id": null,
"name": "GitHub",
"type": "Microsoft.Web/sourcecontrols",
"properties": {
"name": "GitHub",
"token": "***************************************",
"tokenSecret": null,
"refreshToken": null,
"environment": null
}
}
The same also happens if I try and set up CD with the App Service Build Service. I’ve tried changing the token already there for a new fresh token I manually generated on Github, but still, no go. The same happens with a different Github account as well. How should I set up CD for my Azure App Service?
2
Answers
Check the below steps for Continuous deployment of Azure Web Apps.
In Azure Portal Create an App Service.
Create a Node JS App from either
VSCode
orVisual Studio
and push the source to GitHub Repository.From
Deployment Center
=>Settings
=>select the SourceGitHub
Under Continuous Deployment.We need to Authorize the GitHub Account and select the correct repository and branch.
Once we connect to the GitHub a new folder
.github/workflows
will be created with theworkflow
(yaml file).My Yml file*
OutPut:
yml
file, go to theGitHub Repository
=>Workflows
=>.github/workflows
folder => click on the file and edit.Authorized OAuth Apps
in GitHub.In your
GitHub
Account => in the right paneSettings
=> left paneapplications
=>Authorized OAuth Apps
.Try running this in azure console (terminal-looking icon on top right).