I have a read-only data file (for IP geolocation) that my web role needs to read. It is currently in the App_Data folder, which is not included in the deployment package for the cloud service. Unlike "web deploy", there is no checkbox for an azure cloud service deployment to include/exclude App_Data.
Is there a reasonable way to get the deployment package to include the App_Data folder/files? Or is using Azure storage for this sort of thing the better way to go? (cost and performance wise)
Am using Visual Studio 2013 and the Azure SDK 2.2
UPDATE: - Found that the App_Data files are actually deployed under /bin/App_Data! So they are there. - Actually ended up moving the file to a storage blob, and copying it to a local storage area on the azure server in the app on startup. This greatly reduced the size of the deployment package, since the static file is not being carried in the package.
You can deploy your WAR, JAR, or EAR package to App Service to run your Java web app using the Azure CLI, PowerShell, or the Kudu publish API.
You can deploy your WAR package to Azure App Service to run your Java web app using the Azure CLI, PowerShell, or the Kudu Publish API. Note: It is not recommended of deploying WAR / JAR / EAR packages using FTP or WebDeploy .
Navigate to your app in the Azure portal and select Deployment Center under Deployment. Follow the instructions to select your repository and branch. This will configure a DevOps build and release pipeline to automatically build, tag, and deploy your container when new commits are pushed to your selected branch.
If App_Data is not empty, it will be published on Azure website and you can access it via
var folder = Server.MapPath("~/App_Data/");
You can also create folders and write files there
var folder = Server.MapPath("~/somefolder/");
Directory.CreateDirectory(folder);
var path = folder + "file.txt";
File.AppendAllText(path, "some text");
I experienced the same issue.
after deploying my service, I run a recursive directory search on the local directory on the Azure server
(string appRoot = Environment.CurrentDirectory;
) and found that the stored files are under E:\\approot\\App_Data\\<file name>
then I used the following code appRoot = Path.Combine(appRoot + @"\", @"App_Data\<file name>t");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With