Where is the XML file created by my web application?

Rice Rao 1 Reputation point
2024-03-20T15:29:43.51+00:00

Hi, I have an Azure App Service which creates new XML files (in subfolder 'XMLFiles' of the root folder) upon user requests.

I can see the file created successfully via the url below

https://xxx.azurewebsites.net/XMLFiles/GPS_032024_150850.XML

However, when I login Azure portal and check in the console, the corresponding folder "C:\home\site\wwwroot\XMLFiles" is empty. Where is the file stored?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,025 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 8,840 Reputation points
    2024-03-20T22:24:27.6833333+00:00

    Hi Rice,

    Thanks for posting your question in the Microsoft Q&A forum.

    In Azure App Service, files created dynamically by your application are not stored directly in the file system of the App Service. Instead, Azure App Service provides a temporary storage mechanism for files created during application runtime.

    it means that the file is being served by your application from the temporary storage provided by Azure App Service, not from the file system.

    If you need to persist files permanently, you should consider using Azure Storage services such as Blob Storage, File Storage, or Azure SQL Database, depending on your specific requirements.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


  2. SnehaAgrawal-MSFT 21,926 Reputation points
    2024-03-27T07:42:41.68+00:00

    @Rice Rao Thanks for reaching here!

    1. In the Azure portal, open the Azure App Service.
    2. Go to Get publish profile and save the profile locally. Get the publish profile A file with a .publishsettings file extension has been generated in the location where you saved it. This is a XML file with all the information like Server Name, Username, Password The following code shows a partial example of the file (in a more readable formatting).
         <publishData>
           <publishProfile
             profileName="DeployASPDotNetCore - Web Deploy"
             publishMethod="MSDeploy"
             publishUrl="deployaspdotnetcore.scm.azurewebsites.net:443"
             msdeploySite="DeployASPDotNetCore"
             userName="$DeployASPDotNetCore"
             userPWD="abcdefghijklmnopqrstuzwxyz"
             destinationAppUrl="http://deployaspdotnetcore2021.azurewebsites.net"
             SQLServerDBConnectionString=""
             mySQLDBConnectionString=""
             hostingProviderForumLink=""
             controlPanelLink="http://windows.azure.com"
             webSystem="WebSites">
             <databases />
           </publishProfile>
         </publishData>
         
         
         
      

    Typically, the preceding *.publishsettings file contains two publishing profiles that you can use in Visual Studio, one to deploy using Web Deploy, and one to deploy using FTP. The preceding code shows the Web Deploy profile. Both profiles will be imported later when you import the profile.

    Also, In App Service file system- One folder is generated for each failed request, which contains the XML log file, and the XSL stylesheet to view the log file with.

    Also note that When stored in the App Service file system, logs are subject to the available storage for your pricing tier. (see App Service limits).

    For more details- see- https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#log-detailed-errors

    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.