Welcome to today’s post.
In today’s post I will show how to troubleshoot continuous integration (CI) with GitHub and the Azure App Service.
Before we commence this blog, it helps to have read my previous post on configuring CI with GitHub and Azure App Service.
In cases where the deployment has failed, I will introduce a method to diagnose and also suggested remediation to enable successful deployment from the configured GitHub repository.
Firstly, to discover deployment errors, go to your App Service.
Then, under Deployment select Deployment Center. Look for the Status column.
If it shows as Failed, then proceed to troubleshoot as follows:
Open the Kudu Services dashboard for your application service by browsing to:
Click on Diagnostic Dump as shown:
A zip file will be downloaded to your local machine of the format:
Open the zip and navigate to folder:
Open file log.txt
Usually this log file will contain the reason for the error. In this case the Kudu build has detected multiple .csproj files in the same repository. An example error will be dumped as shown:
2019-12-25T13:59:06.6336872Z,D:\Program Files (x86)\dotnet\sdk\2.2.109\NuGet.targets(241,5): error MSB3202: The project file “D:\home\site\BookLoanTest\BookLoanTest.csproj” was not found. [D:\home\site\repository\BookLoan.sln],,0
As a temporary workaround, try editing the (sln) solution file in the folder:
Open the solution file:
Remove the reference that is causing the error.
Attempt a rebuild.
This will fail again!
Why? Because the deployment script gets the same solution file from the remote repository!
One suggestion is to remove the test project from the solution file in the local Git development environment, then commit and push back to the remote repository.
Let’s try that.
Back in Visual Studio, remove the unit test from the solution.
Commit change to Git.
Push change to GitHub.
In GitHub confirm the changes to the branch have been applied:
In the Azure Portal, return to the Application Service Deployment Centre.
Check the status column in the deployment section.
If the status shows as Success (Active), then your deployment has been triggered and is successful without errors!
If you download the diagnostic dumps and open log.txt, you will see at the bottom of the file:
Now test by browsing to the web site:
I hope this has been useful and informative post to diagnosis and troubleshooting continuous integration of your GitHub projects with your Azure Application Service.
Andrew Halil is a blogger, author and software developer with expertise of many areas in the information technology industry including full-stack web and native cloud based development, test driven development and Devops.