Reputation: 41
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
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
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:
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