I created my AKS cluster about a year ago. Back then container insights was not a thing. Now it is and it’s so good and makes life a bit easier. But at first, I was unable to use it I kept getting an error. After some googling, I came across the solution which I will go through below.
The Error
In Azure go to your Kubernetes Cluster Then click in insights on the left. Just under Monitoring. Now click on Containers. Pick a container that you would like to see the live logs for and then click on the Blue button saying view live data (preview).

You may then be asked to log in. If you try to log in you will get an error like this.

The fix
The above error is basically saying the return address does not match any in the active directory application we have created. So the fix is nice and easy. We have to add the return address to our application in Azure AD.
To do this in Azure go to Azure Active Directory and click on App registrations and search for your applications.

Now, click on your client application, so in my case aks-dev-client and then click on Authentication on the left.

n here you will need to add in two redirect URLs as Web application types.
1 2 3 |
https://afd.hosting.portal.azure.net/monitoring/Content/iframe/infrainsights.app/web/base-libs/auth/auth.html https://monitoring.hosting.portal.azure.net/monitoring/Content/iframe/infrainsights.app/web/base-libs/auth/auth.html |
So, basically just copy and paste the URLs into the boxes. Now if you scroll down under Advanced settings and make sure both Access tokens and ID tokens have a tick you will be ready to save the config and check you live logs. Just scroll up to the top and click Save.

If you head back to your kubernetes cluster and check the live logs as before you should now see live log data. You will probably be asked to sign in again and if it does not work the first time just close your browsers down and try again, sometimes it can help pull the token down.

And there you have it you can now use the awesome feature View live data. I hope you found this article helpful. If you did why not reach out or share it. If you have any questions or comments please reach out in the usual ways.
0 Comments