Public File access on website hosted on App Server

David Wipper 50 Reputation points
2024-01-23T17:07:54.4+00:00

We have an app running in a Docker container on a App Server. We would like the users to be able to share out content that is produced in the app (and saved in a .html file), via a web link something like: https://myapp.azurewebsites.net/files/rec4AIDQ8q1waHlDX20240122162322.html . The app currently write the files to a /files/ folder in the Docker container, but it appears that folder isn't accessible via the https://myapp.azurewebsites.net site. We aren't particularly worried about the security of the files since they don't contain any private or proprietary information. Public Read-only should be fine. I've looked at a variety of postings about accessing files, blobs, etc. but it's a bit hard to follow. I tried configuring a storage account and mapping that to the app server, but it wasn't clear how to get files written from the Docker container to the Blob storage and/or what the URL would be to access a file in the Blob storage. Any help would be greatly appreciated!

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,422 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,939 questions
{count} votes

Accepted answer
  1. Lex Li (Microsoft) 6,037 Reputation points Microsoft Employee
    2024-01-23T23:41:55.5833333+00:00

    Since you are using Python and Gradio, you need to mount together with a web framework like FastAPI so as to serve static files. An example can be found from https://discuss.huggingface.co/t/how-to-serve-an-html-file/33921


1 additional answer

Sort by: Most helpful
  1. Carlos dos Santos 85 Reputation points Microsoft Regional Director
    2024-01-23T23:43:31.17+00:00

    Hi @David Wipper What languange are you using to develop ?


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.