ApplicationInsights> TelemetryChannel> StorageFolder中的更改未反映

问题描述

我对Windows Server 2016上的认存储文件夹有权限问题,我在TRACE上始终遇到以下错误

AI (Internal): [Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel] Unauthorized access dequeuing file,folder not accessible: 5dd29ef58369a24b5a015ae5d7a400adffee3c3f379057066bda9dd1ad8a4771. Exception: System.UnauthorizedAccessException: Access to the path 'C:\Windows\TEMP\Microsoft\ApplicationInsights\5dd29ef58369a24b5a015ae5d7a400adffee3c3f379057066bda9dd1ad8a4771' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode,String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path,String originalUserPath,String searchPattern,SearchOption searchOption,SearchResultHandler`1 resultHandler,Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern,SearchOption searchOption)
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.PlatformFolder.GetFiles() in E:\A\_work\13\s\BASE\src\ServerTelemetryChannel\Implementation\PlatformFolder.cs:line 46
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.TransmissionStorage.GetTransmissionFiles() in E:\A\_work\13\s\BASE\src\ServerTelemetryChannel\Implementation\TransmissionStorage.cs:line 257
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.TransmissionStorage.LoadFilesOrderedByDateFromFolder() in E:\A\_work\13\s\BASE\src\ServerTelemetryChannel\Implementation\TransmissionStorage.cs:line 284
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.TransmissionStorage.GetoldestTransmissionFileOrNull() in E:\A\_work\13\s\BASE\src\ServerTelemetryChannel\Implementation\TransmissionStorage.cs:line 268
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.Implementation.TransmissionStorage.Dequeue() in E:\A\_work\13\s\BASE\src\ServerTelemetryChannel\Implementation\TransmissionStorage.cs:line 134.

我尝试通过引用to documentation hereApplicationInsights.config添加以下更改:

<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel,Microsoft.AI.ServerTelemetryChannel">
                <StorageFolder>D:\ApplicationInsights\My.App.API\Prod</StorageFolder>
</TelemetryChannel>

但这不会产生任何效果。我在这里做什么错了?

解决方法

这是我创建的自定义文件夹上的权限问题。在报告GitHub

的问题后,我才意识到这一点