This was really confusing because I was sure that the new service I was deploying to AKS was basically the same as one that was already working but when deploying, my pods were showing the following (with kubectl get pods):

0/1     CrashLoopBackOff     8     2m30

Where the 0/1 is the ready number and 8 is the number of restarts.

If you call kubectl describe pod/ you get stuff that isn't too helpful except it says it is terminated and the exit code: 140 - hmmm.

I then realised that you could call kubectl log -p and got something MUCH more helpful:

Error: An assembly specified in the application dependencies manifest Microservices.Messaging.deps.json) was not found: package: 'Dapper.Contrib', version: '2.0.30' path: 'lib/netstandard2.0/Dapper.Contrib.dll'

This is when I realised that I had copied the new (broken) Dockerfile from a service that runs unit tests and does not include any third-party packages (and is currently unused!) and the service that is actually working does not run unit tests and does have third-party packages.

What I had done was by adding in a unit test step, I had removed dotnet publish, thinking it was not doing anything special. Of course, what it does is package all referenced packages into the target directory ready for deployment. Added this back in and all was good with the world again.