none
Can someone please explain how to access Blob storage from Windows Store app?

    Question

  • Super frustrated with the documentation

    http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/

    First of all the instructions for setting up the connection string are not for Windows Store App, since I realized you can't create an app.config file for Windows Store project. 

    So question one.  How do you configure the connection string in a Windows Store App?

    Next problem was in the next step, How To Programmatically access Blob storage.  It instructs to "  use NuGet to obtain the Microsoft.WindowsAzure.Storage.dll assembly"  But when you try to install the Windows Azure Storage package, it says it is not compatible

    Friday, July 19, 2013 2:45 AM

Answers

All replies

  • How do you configure the connection string in a Windows Store App?

    You can define connection string as follows:

    "DefaultEndpointsProtocol=[http/https];AccountName=[accountname];AccountKey=[accountkey]"

    for connecting to storage emulator, you can define connection string as:

    "UseDevelopmentStorage=true"

    Next problem was in the next step, How To Programmatically access Blob storage.  It instructs to "  use NuGet to obtain the Microsoft.WindowsAzure.Storage.dll assembly"  But when you try to install the Windows Azure Storage package, it says it is not compatible

    Regarding the 2nd question, what you need is a library for Windows 8 applications. Microsoft.WindowsAzure.Storage.dll library is for classic .Net applications and not Windows 8 applications. Unfortunately that is not distributed with .Net SDK. I've seen a direct download link somewhere but couldn't find it right now. One thing you could do is download the source code for .Net SDK from GitHub (https://github.com/WindowsAzure/azure-sdk-for-net), open the solution in Visual Studio and compile RT project (https://github.com/WindowsAzure/azure-sdk-for-net/tree/master/microsoft-azure-api/Services/Storage/Lib/RT). This will give you the necessary binary files (*.winmd) which you can reference in your Windows 8 application.

    Friday, July 19, 2013 3:42 AM
  • HI

    You have two options,

    1, Use Azure latest storage.winmd

    Please refer to One-Code sample:

    http://code.msdn.microsoft.com/windowsapps/How-to-use-MicrosoftWindows-13af488c

     In this sample readme, it will explain how to install Storage winmd and make it work.

    2.Use Azure Mobile service:

    http://code.msdn.microsoft.com/windowsapps/Upload-File-to-Windows-c9169190


    Please mark post as answered if it helped!


    • Proposed as answer by Yuan2013 Friday, July 19, 2013 5:44 AM
    • Edited by Yuan2013 Friday, July 19, 2013 6:05 AM add more details
    • Marked as answer by Sal_S Sunday, July 21, 2013 11:16 PM
    Friday, July 19, 2013 5:44 AM
  • HI

    You have two options,

    1, Use Azure latest storage.winmd

    Please refer to One-Code sample:

    http://code.msdn.microsoft.com/windowsapps/How-to-use-MicrosoftWindows-13af488c

     In this sample readme, it will explain how to install Storage winmd and make it work.

    2.Use Azure Mobile service:

    http://code.msdn.microsoft.com/windowsapps/Upload-File-to-Windows-c9169190


    Please mark post as answered if it helped!


    Thanks very much the example was helpful.
    Sunday, July 21, 2013 11:16 PM
  • Its gives me this error when i try to show image.

    Cannot convert the specified Windows Runtime stream to a managed System.IO.Stream object without
    a buffer because this Windows Runtime stream has been previously converted to a managed Stream
    object with a buffer. Ensure that the 'bufferSize' argument matches the existing buffer or use the
    'AsStreamForWrite'-overload without the 'bufferSize' argument to convert the specified Windows Runtime stream
    to a Stream object with the same buffer size as previously.

    Monday, January 06, 2014 6:58 AM
  • HI

    Do you use the windows 8.1? This sample is for 8.0.



    Please mark post as answered if it helped!

    Tuesday, January 07, 2014 2:55 AM
  • HI

    the solution is easy

     change to

       using (var fileStream=await file.OpenAsync(FileAccessMode.ReadWrite))
                    {
    
                        await blob.DownloadToStreamAsync(fileStream);
                    }

    That's all


    Please mark post as answered if it helped!


    • Edited by Yuan2013 Wednesday, March 19, 2014 12:49 PM
    Tuesday, March 18, 2014 12:57 PM