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

Developer technologies ASP.NET ASP.NET Core
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,931 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    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.