Path for diagnostics in Azure App Service deployed via runFromPackage

When hosting a send-only endpoint in an Azure App Service deployed via runFromPackage, the .diagnostics folder cannot be created at runtime.
I tried including the correct .diagnostics/{endpoint}-configuration.txt file in the deployment package, but even then, I get this error : Invalid access to memory location. : ‘C:\home\site\wwwroot.diagnostics{endpoint}-configuration.txt’

What is the best practice for this scenario? Setting the diagnostics path to C:\home\LogFiles and only use that path for non local development scenario’s?

All tips are welcome!

Btw, full exception stack trace for the error mentioned above is :

System.IO.IOException:
at System.IO.FileStream.SetLengthCore (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.IO.FileStream.WriteAsyncInternalCore (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.IO.FileStream.WriteAsyncInternal (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.IO.FileStream.WriteAsync (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.IO.Stream.WriteAsync (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at NServiceBus.AsyncFile+d__0.MoveNext (NServiceBus.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c: //src/NServiceBus.Core/Transports/Learning/AsyncFile.cs:15)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at NServiceBus.HostStartupDiagnosticsWriter+d__1.MoveNext (NServiceBus.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c: /
/src/NServiceBus.Core/Hosting/StartupDiagnostics/HostStartupDiagnosticsWriter.cs:38)

Hi Ruben,

That is peculiar. It is a good idea to capture startup diagnostic files somewhere less volatile. We have documented how to do that here. I’ll check internally if this is a bug and can be fixed for Azure App Service.

Please let us know if changing the diagnostics directory as documented above would work for you.

Regards,
Hadi

Hi Hadi,

Yes, changing the diagnostics path to C:\home\LogFiles for non local development scenario’s works