According to a message in the Azure Portal “Classic Application Insights is deprecated and will be retired in February 2024”. That means it’s time to think about how to configure Application Insights to store it’s data in a Log Analytics Workspace. You can do it manually in the Portal, but I prefer doing these things in Bicep so it can be replicated across all environments automatically.
Luckily despite the lack of documentation it’s quite straight forward as you can see from the Bicep file below. As an extra bonus I’ve included how you can limit the maximum daily ingestion on the Workspace by providing a value for dailyQuotaGb. Note: Bicep expects an integer, however in order to set the minimum possible value of 0.023 GB you need to pass it as a string which will work just fine.