Continuous deployment
Azure Azure App Services CICD Continuous Deployment Continuous Integration DevOps Diagnostics GitHub Kudu

Troubleshooting Continuous Integration with GitHub and Azure App Service

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:

http://[app name].scm.azurewebsites.net/

Click on Diagnostic Dump as shown:

A zip file will be downloaded to your local machine of the format:

dump-MM-DD-HH-MM-SS.zip

Open the zip and navigate to folder:

\deployments\[GUID]

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:

D:\home\site\repository

Open the solution file:

Remove the reference that is causing the error.

Save changes.

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.

Save.

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:

2019-12-26T09:37:59.8449306Z,Deployment successful.,2206ae50-ac29-481f-835e-79a98d82c4c4,0

Now test by browsing to the web site:

http://[app name].azurewebsites.net/

That’s all!

I hope this has been useful and informative post to diagnosis and troubleshooting continuous integration of your GitHub projects with your Azure Application Service.

Social media & sharing icons powered by UltimatelySocial