The Classic Application Insights will be retired on 29 February 2024. We have to migrate Classic AI to workspace-based Application Insights resources.

If you currently store Application Insights data for longer than the default 90 days and want to retain this longer retention period after migration, adjust your workspace retention settings. In addition, If you've selected data retention longer than 90 days on data ingested into the classic Application Insights resource prior to migration, data retention continues to be billed through that Application Insights resource until the data exceeds the retention period.

So, we need to save the cost by adjust the retention policy is 90 days. This leads to another issues that how we can keep the historical data for something like: PowerBI or do other things.

The solution:

Keep the retention 90 days as default and using Logic App to export data as JSON file to Blob Storage.

There are some steps as below

1. Create a Resource Group 

2. Create a Storage Account or Data Lake Gen2

2.1 Create a Storage account and Enable the hierarchical namespace

2.2 Create a container: log-analytics-content

3. Create a Logic App

3.1 Create a logic app workflow

3.2 Create a trigger for the workflow

3.3 Add an Azure Monitor Logs action

3.4 Add the Compose action

3.5 Add the Create blob action

3.6 Test the workflow

4. View logs in storage