Sgame Ict
Sgame Ict

Reputation: 41

Can we directly connect Windows Azure mobile service with the BLOB storage?

I have a question about how I can implement Windows Azure and Blob storage with Windows 8 app (Javascript). Can we directly connect Windows Azure mobile service with the BLOB storage?

Upvotes: 4

Views: 967

Answers (2)

Mlunes
Mlunes

Reputation: 481

Yes, you can access blob storage through Windows Azure Mobile Services. Essentially you're going to work with blob storage through server scripts. You're going to use the “azure” module within the Windows Azure SDK for Node.js.

If you copied the below into a script, you'd get a reference to a Windows Azure blob after which you could query it or insert data to it.

var azure = require('azure');
var blobService = azure.createBlobService("<< account name >>",
                                            "<< access key >>");

You can check out Scott Guthrie's post announcing this here: http://weblogs.asp.net/scottgu/archive/2012/10/16/windows-azure-mobile-services-new-support-for-ios-apps-facebook-twitter-google-identity-emails-sms-blobs-service-bus-and-more.aspx.

This is a post detailing how to use Scheduler to run a scheduled script that backs up your data to blob storage: http://www.thejoyofcode.com/Using_the_scheduler_to_backup_your_Mobile_Service_database.aspx

This is a post that covers how to upload an image to blob storage from Mobile Services: http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/

There's more information available regarding working with blobs here: http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/

Hope that helps.

Upvotes: 4

Gaurav Mantri
Gaurav Mantri

Reputation: 136216

I personally haven't tried it but using Windows Azure Storage Client library for Windows 8 it should be possible. There're two ways by which you can access blob storage:

  1. Using storage account name and key: This is not recommended in case of a client application because you would need to share storage account name and key which is a big security risk as anybody in possession of the key is essentially an administrator on that storage account.
  2. Using Shared Access Signature (SAS): This is a recommended practice as you're giving limited and time bound permissions to your blob storage. Users with SAS URL can only do things you allow them to do (e.g. you could restrict users from deleting blobs in a blob container and only allow them to list blobs there or upload a file.

Do take a look at the following code sample where a SAS URL is generated using Mobile Service and passed on to a Windows 8 application using which the application directly interacts with Windows Azure Blob Storage: http://code.msdn.microsoft.com/windowsapps/Upload-File-to-Windows-c9169190.

Upvotes: 1

Related Questions