Can't create a file in Azure App Service file system

474 Views Asked by At

I am trying to create a file in azure app service file system. My app is a .NET c# app. Doing it like this currently:

var tempDirectoryPath = Environment.GetEnvironmentVariable("TEMP");
string filePath = tempDirectoryPath + "myfile.xlsx";

Doesn't work for some reason... But it also doesn't give me any error in the logs. Does anyone know why it doesn't create my file?

1

There are 1 best solutions below

0
SnehaAgrawal-MSFT On

Could you please confirm your privileges, Try using below command:

var tempDirectoryPath = Environment.GetEnvironmentVariable("TEMP");
var filePath = Path.Combine(tempDirectoryPath, Request.Files["file"]);