Control and verify the content that is uploaded or not to Azure when the app is deployed

Jalza 761 Reputation points

I'm developing web application with ASP.NET Core MVC (.NET 5). This application provides certain content to specific devices, such as images or applications. These contents are stored in specific folders within
, such as
. These folders did not initially exist in the Visual Studio solution, but during development they were created at runtime. That is, to test that these folders were created and files were uploaded correctly, I tested it by running from Visual Studio and they appeared automatically in the Solution Explorer's file tree (created folders and uploaded files). It is good for me to keep these folders and files for development, but I am not interested in having them uploaded when deploying in Azure. Nor do I want an update of the web application to delete the files that the user has previously uploaded.

I would like to ask the following questions in relation to what was previously explained:

  • How can I verify the content in the Azure
    folder? How could I delete or upload content to this folder?
  • When deploying the application from Visual Studio, can you define or set that these folders should not be uploaded?
  • If these folders,
    , already exist in the Azure folder, when deploying the application for an update are they overwritten if they are in the Visual Studio Solution? Or are deleted if they are not in the Solution?
A set of technologies in the .NET Framework for building web applications and XML web services.
4,288 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,171 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JasonPan - MSFT 4,701 Reputation points Microsoft Vendor

    Hi @Jalza

    The storage size of Azure App Service is determined by the pricing tier of the App Service Plan. If as the usage time of the webapp grows, if the contents of your images and apks folders will increase, in this case, we do not recommend that you store the file resources in the App Service.

    It is recommended to use azure blob storage to store files if the content of files increases over time. If there are only static resource files necessary for the project, then there is no need to care about this issue.

    Regarding your question, I will answer below:

    1. You can check the file by kudu site and FTP tools,then you can operate on the file. 1. How to view, add, edit and remove files in Azure Web App using the Kudu service Dashboard 2. How do I set up FTP access to Azure App Service?
    2. You can use ItemGroup in the .csproj file to decide which files or folders to include or exclude when compiling and publishing. 1. .NET Core include folder in publish 2. How to: Exclude files from the build
    3. Although the second suggestion can meet most of the requirements, if the images and apks files do not need to be deployed and used frequently, it is recommended to create them at the wwwroot layer. And in the .csproj file, exclude these two folders.
      Reason: Although because of each deployment process, the original file will be overwritten and replaced. However, it is likely to cause dirty data due to deployment errors. 152906-image.png

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    0 comments No comments