none
Can not access clientaccesspolicy.xml in $root container RRS feed

  • Question

  • Hi,

         Recently,I have been studying windows Azure and Silverlight.

    I am trying to use silverlight to upload file directly to Azure storage.

    and I download a sample project at http://blog.smarx.com/posts/uploading-windows-azure-blobs-from-silverlight-part-2-enabling-cross-domain-access-to-blobs .

    An error accured at :

    var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
    

    and I change it to :

    var account = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("DataConnectionString"));

    Than it can run .

    But when I select files and upload them, Another error accured at .


    It seems like silverlight can not access these two files.



    I am using silverlight 5 and Azure SDK 1.7.

    What did I do wrong?

    Best Regards,

    Eddy Lin



    • Edited by Eddy-Lin Friday, August 24, 2012 9:34 AM
    Friday, August 24, 2012 9:32 AM

Answers

  • You need to use real cloud storage. The storage emulator uses a different URL structure (127.0.0.1:1000/<account>/<rest> instead of <account>.blob.core.windows.net/<rest>).

    There's no way to get the storage emulator to serve a file from the root.

    • Marked as answer by Eddy-Lin Saturday, August 25, 2012 6:17 AM
    Saturday, August 25, 2012 3:19 AM

All replies

  • Hi,

    Do you put the code in Global.asax file or WebRole.cs file, i think the Cloud storage account must be initialized in Global.asax file (Application_Start method), if so, try to move your code.

    If you move the code but still get the same error message, i'd like to suggest you provide more info about the error, for example, inner exception, tracing message, stack message, etc. More info will help us fix it, i think.

    Hope this helps.


    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

    Friday, August 24, 2012 10:01 AM
    Moderator
  • This is an example project I downloaded from web. I think it ran well before.

    The storage account is initialed correctly,

    Error accurs when silverlight uploading blobs to container.









    • Edited by Eddy-Lin Friday, August 24, 2012 11:53 AM
    Friday, August 24, 2012 11:35 AM
  • I heard that we need to put a clientaccesspolicy.xml in $root container,in order that silverlight can access files cross domain in azure.But the file is right there in $root container and silverlight can not get it.

    Here are two requests silverlight client made and responses of them :

    GET http://127.0.0.1:10000/clientaccesspolicy.xml HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    Host: 127.0.0.1:10000
    Connection: Keep-Alive
    
    
    HTTP/1.1 400 One of the request inputs is out of range.
    Content-Length: 226
    Content-Type: application/xml
    Server: Microsoft-HTTPAPI/2.0
    x-ms-request-id: c2a1e0a8-fc15-47d2-937c-2527d2057515
    Date: Fri, 24 Aug 2012 11:43:26 GMT
    
    <?xml version="1.0" encoding="utf-8"?><Error><Code>OutOfRangeInput</Code><Message>One of the request inputs is out of range.
    RequestId:c2a1e0a8-fc15-47d2-937c-2527d2057515
    Time:2012-08-24T11:43:26.9492187Z</Message></Error>


    GET http://127.0.0.1:10000/crossdomain.xml HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    Host: 127.0.0.1:10000
    Connection: Keep-Alive
    
    
    HTTP/1.1 400 One of the request inputs is out of range.
    Content-Length: 226
    Content-Type: application/xml
    Server: Microsoft-HTTPAPI/2.0
    x-ms-request-id: 4bfb4e2f-5741-4e9b-9ae6-26083aae4dba
    Date: Fri, 24 Aug 2012 11:43:26 GMT
    
    <?xml version="1.0" encoding="utf-8"?><Error><Code>OutOfRangeInput</Code><Message>One of the request inputs is out of range.
    RequestId:4bfb4e2f-5741-4e9b-9ae6-26083aae4dba
    Time:2012-08-24T11:43:26.9560546Z</Message></Error>

    I hope these helps.

    Best Regards,

    Eddy Lin



    • Edited by Eddy-Lin Friday, August 24, 2012 11:52 AM
    Friday, August 24, 2012 11:35 AM
  • You need to use real cloud storage. The storage emulator uses a different URL structure (127.0.0.1:1000/<account>/<rest> instead of <account>.blob.core.windows.net/<rest>).

    There's no way to get the storage emulator to serve a file from the root.

    • Marked as answer by Eddy-Lin Saturday, August 25, 2012 6:17 AM
    Saturday, August 25, 2012 3:19 AM
  • Thanks a lot ,Steve.
    Monday, August 27, 2012 1:37 AM