This will be a quick post. I just figured something out and I want to write this and publish it before my daughter wakes up.
Anyway! The Log Stream in an Azure App Service is a great way to see what’s happening in whatever apps you have running. For example, if you have a .NET Core WebAPI app hosted in an Azure App Service Web App, all the calls to ILogger<T> show up right in the log stream…
…theoretically.
If your Azure App Service web app is hosted on Linux, it just works. All the console logging messages just appear without having to do anything special at all. If you’re hosting on Windows, it turns out you have to do something extra to make it work.
Enable the Extension
The first step is to go to the Azure Portal (portal.azure.com) and navigate to the admin page for your Azure App Service.
From there, find Development Tools in the left side menu bar. Under Development Tools, you’ll find Extensions. Click on Extensions.
You should now see the list of extensions that have been installed into your App Service. You now need to install the ASP.NET Core Logging Integration extension. Click on the Add button and then choose ASP.NET Core Logging Integration from the list.
After you choose the extension, click the Add button.
That’s it. Your log stream should be filling up with messages. You’re done.
I hope this helps.
-Ben
Leave a Reply