i am new to the windows azure web application deployment.
i developed mvc web application and publish to the windows azure cloud platform.
i have one folder name Messages, that contains the images that i have upload via application. now after user upload images in web app once the app is published on cloud.
next time when i republish the application to the cloud
that "Messages" folder contents (images) are removed.
can you please help me, how to resolve this?
Regards, Brijesh vaidya
This is the expected behavior. Anytime you redeploy your application, new VMs are created for your application. You should not store anything that you want to persist on VM. Instead store them in blob storage. So in your case, you should upload the image and once the image is uploaded, transfer it to blob storage. You may want to check out this hands-on-lab in Azure training kit: https://github.com/WindowsAzure-TrainingKit/HOL-IntroToCloudServices-VS2012
Related
If I have an Azure web app which has to download a file from Azure storage, save it to a folder then process it.
If the Azure web app is upgraded/ updated by Microsoft, will my saved file be lost?
As long as you write the files under the %HOME% folder, they will be persisted regardless of upgrades performed by Microsoft. Only you can ever modify those files.
See this page for more details.
I have a legacy asp.net application (EG:www.mycompany.com). There are around 10 folders inside that application and one of them has lot of images (reads/write) (EG www.mycompany.com/images/1.jpg) around 3 TB.
We are migrating this application to Azure VM. What we trying to do here is, keep all the 9 directories of that application inside the VM disk and move the images folder alone to Azure Storage.
So we created an Azure file share, created an local account with the same credentials as Azure Storage. Gave the local account IIS_USR group and then run the web application under this user.
We created a virutal directory called "images" inside the web application and linked that to say "\XXXX.file.core.windows.net\images".
The problem i am facing now is, we are able to read the file and show it in the web browser, but we are unable to upload a new image. When trying to upload an image from the web browser (thru the web application), it actually creates a folder called "images", because the code behind it uses server.mappath.
Is there any other alternative implementation without an code change.
We ended up creating a symbolic link for the images folder, that points to azure storage. Created a local vm user with same credentials as the azure storage account and ran IIS with that local user.
Everything worked fine.
I am using VS Team Services to build and deploy my Asp.net MVC application to Azure. When the application is running, users can upload files to a directory.
The problem is that when I run a new build and deploy task in Team Services it overwrites or deletes the files that were uploaded by my users.
It seems like Team Services erases the target location before it does the deployment.
Is there a way in Team Services to tell it not to delete a specific directory when it is deploying an update to the application?
If I cant do that then is there a way to automate the copying of the original files before the deployment, then write them back after the deployment?
I've been searching google most of the day and cant seem to find an answer.
Thanks
Tony
I believe there is a better approach. Your user data should be saved to Azure blob storage, not uploaded to the web deployment location.
Here is a good getting started tutorial on using Azure storage: https://learn.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-blobs
It is not recommended for user files to be stored in the same directory as the web site. Even if you simply load them into file storage on your VM, it should be in its own location.
There is Remove Additional Files at Destination option in Additional Deployment Options of Azure App Service Deploy step/task.
So If you check this option, it will delete additional files on AzureRM Web APP otherwise, it won’t delete additional files.
I successfully created a backup file from my first app service using an Azure feature.
Is it possible to restore the backup file to another app service?
If not, is there a way to download the backup file, upload then extract it to the other app service? Please advise.
Yes, you can restore a backup of a web app to another one. But, you need to do more than just clicking the Restore Now button.
Log into the new Portal, on the Settings blade of your web app, click Backups, choose the backup you want to restore, and copy the file location. It would look like this:
https://<your storage account name>.blob.core.windows.net/<your container>?sv=2015-04-05&sr=c&sig=fieQjleVYxDuXG2Ym8yjPpbdPxHOnbiLo8HcRuxyluw%3D&st=2016-04-05T02%3A35%3A25Z&se=2290-01-18T02%3A35%3A25Z&sp=rwdl
From the above URL, you can format a link to download the backup file, by adding the file name after the container name. Here is a link to the zip file:
https://<your storage account name>.blob.core.windows.net/<your container>/<your web app>.zip?sv=2015-04-05&sr=c&sig=fieQjleVYxDuXG2Ym8yjPpbdPxHOnbiLo8HcRuxyluw%3D&st=2016-04-05T02%3A35%3A25Z&se=2290-01-18T02%3A35%3A25Z&sp=rwdl
Download the files with the above link. You get a zip file. Since you are restoring it to a different web app, you can ignore the xml and the log files.
Unzip the zip file, and you will see a .bacpac file, a meta file, and a "fs" folder. You can ignore the meta file.
You can use Visual Studio or SSMS to restore the .bacpac file to a database linked to your new web app.
For files inside the "fs" folder, you can use a ftp client to upload it to your new web app. Don't forget to change the connection string, before uploading.
In fact, it's quite complicated. If you are just restoring a quite recent version of your web app. I suggest you skip step 6, and use your most favorite deploy method to deploy it to you new web app.
If you just want to clone a web app, you can do it through the new portal. For more information, see Azure App Service App Cloning Using Azure Portal
I have deployed my web app and the cloud service on windows azure. Web app saved some of the image files on its own directory lets say on root of the website there is folder name "Content" and web app save the image files on this folder. is there a way a cloud service can access files inside that folder? cloud service is separate project and hence has its own url and hosted on windows azure portal.
AFAIK, it is not possible to share files stored in a web app with a cloud service. What you should do instead is save the files in Blob Storage. That way both Web App and Cloud service can have access to the files.
Another option you have is Azure File Services, you will have the chance to used as a network shared location.
take a look at this here:
https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/