I have an Azure Function in C#. I regularly get the following error:
System.UnauthorizedAccessException: Access to the path '/tmp/' is denied.
?, in void Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, string path, bool isDirectory, Func<ErrorInfo, ErrorInfo> errorRewriter)
?, in SafeFileHandle SafeFileHandle.Open(string path, OpenFlags flags, int mode) x 2
?, in new OSFileStreamStrategy(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
?, in FileStreamStrategy FileStreamHelpers.ChooseStrategy(FileStream fileStream, string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, long preallocationSize)
File "/src/azure-functions-host/src/WebJobs.Script.WebHost/Management/LinuxSpecialization/PackageDownloadHandler.cs", line 177, col 24, in async Task PackageDownloadHandler.HttpClientDownload(string filePath, Uri zipUri, bool isWarmupRequest, string token, string downloadMetricName)
File "/src/azure-functions-host/src/WebJobs.Script.WebHost/Management/LinuxSpecialization/PackageDownloadHandler.cs", line 119, col 17, in async Task<string> PackageDownloadHandler.Download(RunFromPackageContext pkgContext, Uri zipUri, string token)
File "/src/azure-functions-host/src/WebJobs.Script.WebHost/Management/LinuxSpecialization/PackageDownloadHandler.cs", line 78, col 13, in async Task<string> PackageDownloadHandler.Download(RunFromPackageContext pkgContext)
File "/src/azure-functions-host/src/WebJobs.Script.WebHost/Management/InstanceManager.cs", line 128, col 38, in async bool InstanceManager.StartAssignment(HostAssignmentContext context)+(?) => { } [0]
My code looks like
[FunctionName("Receiver")]
public async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
HttpRequest req,
ILogger log)
{
_logger = log;
var requestBody = await new StreamReader(req.Body).ReadToEndAsync();
var newsletterEvent = new NewsletterEvent();
_logger.LogInformation($"{requestBody} received");
}
Within the function I have no IO or similar access. Does anyone have an idea how I can get rid of the error?

