locked
Accessing blobs in Development and in Azure RRS feed

  • Question

  • Hello,

    I'm developing an MVC3 Azure Application using Blob Storage as a repository for my images.

    In development mode I access the BlobStorage using the http://127.0.0.1/devaccount1/<container>/<blob> with no problem, but in my Azure account I don't use this link.

    What I has found in the internet it's blob access by reading the list of blobs, adding blobs or removing blobs. For this problem, what I had found it's when I have to deploy, change all the links in my application, even my CSS files.

    There aren't any other way? We don't have any way to know if we are in DevStore or Azure and point it?

    My bigger problem it's the images defined in the CSS files... please say that I don't have to change them all the time I need to deploy the application.

    Regards
    Paulo Aboim Pinto
    Odivelas - Portugal

    Sunday, April 3, 2011 5:46 PM

Answers

  • Hi Paulo,

    I have to develop my website using the Azure links and not the DevStore links?

    When we debug the application, we should use local development storage. You can use CloudBlob.Uri Property to get the dynamic URI of that blob. That URI will change according to which storage account is being used. By following to this exercise, Exercise 1: Building Your First Windows Azure Application, you will learn how to link to blob storage from the page.

    Do your CSS files link to images stored in azure storage? If these images are not changing, you should just put them in a folder instead of storing them in azure storage.

    Thanks,

     


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Tuesday, April 12, 2011 5:19 AM
    Tuesday, April 5, 2011 2:41 AM

All replies

  • Hello Paulo,

    I understand that you are storing images in Blob Storage and have concern about how to access these images from CSS files.

    If I guess correctly, these images are static, right? For static resources, please just put them in a folder and let them be a part of your project. These resources will be deployed in many instances (if you use more than one instance) and will be benefited by the load balancer.

    Only when the images are updatable and dynamic, you can switch to Blob Storage. A web role might be hosted in more than one instance and in this case, file system is only for a particular instance. So Blob Storage is recommended to store dynamically data so that other instances can retrieve the updated data.

    To access data from Blob Storage, we can directly use the Blob URI or create an http handler to access the resources. An http handler can help you hide the actual Blob URI, therefore, the CSS files can access images through the http handler.

    Thanks,

    Monday, April 4, 2011 7:27 AM
  • hello and tkx for the answer

    What you said it's true. I have static resources in a folder in the solution folder and have dynamic images to put in the Blob Storage.

    My problem it's the switch between DevStore and Azure. I have to develop my website using the Azure links and not the DevStore links?
    There are any way to do that?


    Regards
    Paulo Aboim Pinto
    Odivelas - Portugal

    Monday, April 4, 2011 1:44 PM
  • Hi Paulo,

    I have to develop my website using the Azure links and not the DevStore links?

    When we debug the application, we should use local development storage. You can use CloudBlob.Uri Property to get the dynamic URI of that blob. That URI will change according to which storage account is being used. By following to this exercise, Exercise 1: Building Your First Windows Azure Application, you will learn how to link to blob storage from the page.

    Do your CSS files link to images stored in azure storage? If these images are not changing, you should just put them in a folder instead of storing them in azure storage.

    Thanks,

     


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Tuesday, April 12, 2011 5:19 AM
    Tuesday, April 5, 2011 2:41 AM