Open PDF in Azure

JORGE MALDONADO BARRERA 211 Reputation points
2022-11-18T19:40:17.01+00:00

I have a website in an Azure App Service that generated a pdf. The pdf generates correctly inside a project folder but I also want to open it. I tried the Process.Start("explorer.exe", fileName) which only works when running my project locally and also Process.Start(fileName) which does not open anything. I also tried the following solution without success:
https://www.learmoreseekmore.com/2021/07/dotnet5-web-api-display-pdf-in-browser.html

I will appreciate any feedback.

Regards,
Jorge

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,623 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,716 Reputation points Microsoft Employee
    2022-11-21T06:01:55.997+00:00

    @JORGE MALDONADO BARRERA ,

    You won't have access to processes like explorer inside an app service; see Operating system functionality on Azure App Service and Azure Web App sandbox for more details. Furthermore, from a web perspective, the client has to request to open/download the PDF file you've generated. On your local environment, you're the client which is why it works. To do similarly, when client makes the request to your app which generates your PDF, your app will need to respond with application/pdf HTTP response.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.