我有一个关于如何使用Windows 8应用程序(Javascript)实现Windows Azure和Blob存储的问题。我们可以直接将Windows Azure移动服务与BLOB存储连接吗?
答案 0 :(得分:4)
是的,您可以通过Windows Azure移动服务访问blob存储。基本上,您将通过服务器脚本使用blob存储。您将在Windows Azure SDK for Node.js中使用“azure”模块。
如果您将以下内容复制到脚本中,则会获得对Windows Azure blob的引用,之后您可以对其进行查询或向其中插入数据。
var azure = require('azure');
var blobService = azure.createBlobService("<< account name >>",
"<< access key >>");
你可以在这里查看Scott Guthrie的帖子: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。
这篇文章详细介绍了如何使用Scheduler运行将数据备份到Blob存储的预定脚本:http://www.thejoyofcode.com/Using_the_scheduler_to_backup_your_Mobile_Service_database.aspx
这篇文章介绍了如何从移动服务上传图片到blob存储空间:http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/
有关于使用blob的更多信息,请访问:http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/
希望有所帮助。
答案 1 :(得分:1)
我个人没有尝试过,但是对于Windows 8使用Windows Azure存储客户端库应该是可行的。您可以通过两种方式访问blob存储:
请查看以下代码示例,其中使用Mobile Service生成SAS URL并将其传递到应用程序直接与Windows Azure Blob存储进行交互的Windows 8应用程序:http://code.msdn.microsoft.com/windowsapps/Upload-File-to-Windows-c9169190。