I have an endpoint that should return a value from an excel file.
On localhost this works by enabling UseStaticFiles
middleware using this code, and adding excel file into the Resources
folder:
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "Resources")),
RequestPath = "/Resources"
});
However when I publish it in the Azure hosting it shows this error and I cannot acces my application nor this excel file.
After I remove the UseStaticFiles
middleware, application works well except for the missing excel file.
So how should I publish and access this file in the Azure environment?