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/
Related
In azure file storage, I have mounted a drive to Azure File storage location.
This mounted drive has images which need to be referred by all web apps and app services. How do I created a virtual Directory using mounted drive? So that I can use the virtual directory to refer the images.
example : \\{filestoragename}.blob.core.windows.net\images\ mounted to the Drive Z:
How to create a virtual directory called "images" pointing to Z: in my Web Application. So image will be referred using the www.domainname.com/images/demo.jpg.
Web App has "Virtual applications and directories" section. But it throws the error as If I try to refer Z: Physical path.
I see, seems you are using code publish web app (common windows Web Apps) instead of Linux Web Apps or Windows Containers Web Apps (docker/container publish) .
If you use Linux Web Apps or Windows Containers Web Apps , you can mount Azure storage related resources here directly :
However, if you are using common windows Web Apps, the config menu looks like below :
common windows web apps can not mount Azure storage related resources directly.
The only way to access Azure storage resources here is using Azure storage REST API.
We have got an approach that login to the Virtual Machine where we hosted the web application , Open the IIS and create a Virtual Directory which is referring the Blob storage location.
Another approach is ....
We have decided to Configure a Azure custom domain for accessing blob data in your Azure storage account, like www.media.domainname.com.
This approach helps us to refer static images placed in one location.
No need create virtual directory for each web site.
Where does the wwwroot folder go when I use "Publish" inside Visual Studio to deploy to Azure Web Apps?
When new instances are created, where does wwwroot folder comes from?
Is wwwroot referenced inside Azure Storage or is it in the local storage of each instance?
How to serve wwwroot files from Azure CDN instead of serving from Azure Web Apps?
As described here in the Kudu docs: https://github.com/projectkudu/kudu/wiki/Understanding-the-Azure-App-Service-file-system:
The storage is shared across your instances. Azure Storage is used behind the scenes for this.
The storage is also persistent.
As for setting up the CDN to serve files from your Web App, you can refer to documentation here: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-content-delivery-network?toc=%2fazure%2fcdn%2ftoc.json.
If you setup the origin hostname as yourapp.azurewebsites.net, then content that would be accessed via yourapp.azurewebsites.net/myimage.png can then be accessed via CDN from yourcdn.azureedge.net/myimage.png.
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 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
I have migrated and deployed my asp.net (2010) application to windows azure cloud service.
I have small doubts here.
In my previous hosting my application files(media, documents) are located in the local folder of ftp site. And storage (db ) was in server. But according to windows azure i just deployed my application to cloud with db created in windows azure portal.
i). How can i use my previous files here?
I'd recommend you store the files that used to be in FTP in Azure Blob storage https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/. If you put them to blob storage you can use something like Cloudxplorer http://clumsyleaf.com/products/cloudxplorer to browse them and upload them. If you really want to use FTP (which I'd not recommend as it an insecure protocol) there is also a blob storage to FTP bridge http://ftp2azure.codeplex.com/