none
404 error while accessing the blob in cdn

    Question

  • Hi Team,

    I have a public container where I store my blob via code.

    I am able to access the item from the container via tha blob url. But when I try to access the blob via CDN I get the 404-Not found error.

    I have set up the CDN 3 days back.

    When I was using the Free trial it was working fine.But when I created the new strorage/container and CDN endpoint with my Visual Studio premium subscription I am getting this issue.

    The endpoint and the quertystring are enabled.Do I need to pay for CDN, I don't think this should be the case.

    Please help me out on this.

    My CDN endpoint is - http://az678809.vo.msecnd.net/

    Eg: My blob url - http://chiprocontainer.blob.core.windows.net/sitecorecontainer/Images/Destination/San%20Fran%20GG%20Bridge.jpg


    Tuesday, October 21, 2014 10:37 PM

Answers

  • hi,

    How did you set your container permission as "public"?

    I suggest you could add this setting permission code into your container:

    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
        container.CreateIfNotExist();
    
        // Create a permission policy to set the public access setting for the container. 
        BlobContainerPermissions containerPermissions = new BlobContainerPermissions();
    
        containerPermissions.PublicAccess = BlobContainerPublicAccessType.Container;
    
        //Set the permission policy on the container.
        container.SetPermissions(containerPermissions);
    

    About above code, I suggest you could refer to this docs(http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.blobcontainerpublicaccesstype.aspx ).

    At the same time, I used the Fiddler and Azure Storage Explore to reproduce this issue:

    1. I create a container named "img" and upload an image

    2.And set the security property in Azure Storage Explore as Public  container. I could visit the CDN endpoint successfully.

    GET http://az678259.vo.msecnd.net/img/test/det/4.jpg HTTP/1.1
    Accept: text/html, application/xhtml+xml, */*
    Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Accept-Encoding: gzip, deflate, peerdist
    Host: az678259.vo.msecnd.net
    If-Modified-Since: Wed, 22 Oct 2014 05:32:35 GMT
    If-None-Match: 0x8D1BBD0B814C51A
    DNT: 1
    Connection: Keep-Alive
    Pragma: no-cache
    X-P2P-PeerDist: Version=1.1
    X-P2P-PeerDistEx: MinContentInformation=1.0, MaxContentInformation=1.0

    But I visit your CDN endpoints, I got the 404 error:

    GET http://az678809.vo.msecnd.net/sitecorecontainer/Images/Destination/San%20Fran%20GG%20Bridge.jpg HTTP/1.1
    Accept: text/html, application/xhtml+xml, */*
    Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Accept-Encoding: gzip, deflate, peerdist
    Host: az678809.vo.msecnd.net
    DNT: 1
    Connection: Keep-Alive
    X-P2P-PeerDist: Version=1.1

    After I changed the container permission, I could get the 404 error in my test container. So I suggest you could set the container permission firstly.

    Any questions about this issue, please let me know.

    Regards,

    Will


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 22, 2014 6:22 AM
    Moderator