问题描述
我对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 here向ApplicationInsights.config
添加以下更改:
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel,Microsoft.AI.ServerTelemetryChannel">
<StorageFolder>D:\ApplicationInsights\My.App.API\Prod</StorageFolder>
</TelemetryChannel>
解决方法
这是我创建的自定义文件夹上的权限问题。在报告GitHub
的问题后,我才意识到这一点