I have an Azure function and I am trying to save a .xlsx file to a temporary folder. My code works locally, but when I publish to Azure I get an error message.
string projectDirectory = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName + @"\temp\";
string tempFilename = "abc.xlsx";
string pathTradeRecFile = Path.Combine(projectDirectory, tempFilename);
My error message. <--- Access to the path 'C:\Program Files (x86)\SiteExtensions\temp\abc.xlsx' is denied.
Can someone please tell me how I can save this file somewhere? I made a folder in my structure named "temp" as one possible solution, but I can't seem to access it.
Any help would be greatly appreciated!!