azure-storage-blobs

Reuse CloudBlobClient Object

為{幸葍}努か 提交于 2019-12-04 02:36:10
I have these two objects for Azure Blob Storage access and want to use them in ASP.NET MVC application. CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("Deesd"); My question is: Can I reuse the same instance of the objects across all the application requests, or should I instantiate a new object in every method? You can reuse instances, just don't access the same instance from multiple threads concurrently because it is not thread safe. UPDATE April 2019 (7yrs later) NOTE: You should always consult the latest

Azure Blob Storage URL : WASB:// vs HTTP://

ε祈祈猫儿з 提交于 2019-12-04 02:26:30
I see that there are different kinds of URLS to access a blob storage like shown below: wasb://XXXXXXXXXX@XXXXX.blob.core.windows.net https://XXXXXXXXXX@XXXXX.blob.core.windows.net What is the difference? what could be the reason for difference? From what I understand, wasb://XXXXXXXXXX@XXXXX.blob.core.windows.net is used to access blob storage through HDInsight (ref: http://www.windowsazure.com/en-us/documentation/articles/hdinsight-use-blob-storage/ ) where as https://XXXXXXXXXX@XXXXX.blob.core.windows.net is used to access blobs through clients supporting HTTP protocol (web browsers etc.).

How to upload images using postman to azure blob storage

一世执手 提交于 2019-12-03 22:30:42
I have been trying to upload an image to my blob container folder using postman,Below is the screenshot Here is the link Authorization of Azure Storage service REST API am using to generate signature and am attaching filename file field in the body while body. var key = "[Storage account key]"; var strTime = (new Date()).toUTCString(); var strToSign = 'PUT\n\nimage/jpeg; charset=UTF-8\n\nx-ms-date:' + strTime + '\nx-ms-meta-m1:v1\nx-ms-meta-m2:v2\n/colony7/folder-customer-profilepic/Home - explorar.jpg'; var secret = CryptoJS.enc.Base64.parse(key); var hash = CryptoJS.HmacSHA256(strToSign,

Windows Azure Storage Emulator Connection String for ASP.NET MVC?

狂风中的少年 提交于 2019-12-03 16:11:23
I am searching for the connection string that is need to be defined to use windows azure storage emulator. So far, all the sources I have found says these connection strings should go to ServiceDefinition and ServiceConfiguration files located in Windows Azure project. However, I am not using Azure project but the ASP.NET MVC 3. For, ASP.NET MVC project, it should probably go to web.config file. However, I have no idea what it should look like ? I have Azure account if that is needed for emulator. Thanks. As this article says connectionstring is DevelopmentStorage=true So in Web.config you can

Azure Storage CloudBlob.Properties are not initialized when using GetBlobReference()

大兔子大兔子 提交于 2019-12-03 16:05:02
问题 I'm trying to get some information about Azure blob (last modified UTC date time). This information is stored CloudBlob.Properties.LastModifiedUtc property. If I use method GetBlobReference() or GetBlockBlobReference(), the Properties of the blob are not initialized (LastModifiedUtc is DateTime.MinDate). If I use ListBlobs() the Properties are initialized correctly (LastModifiedUtc has correct value). Am I doing something wrong when using GetBlobReference function? Is there some way how to

Copy blob between storage accounts

懵懂的女人 提交于 2019-12-03 15:48:38
I'm trying to copy a blob from one storage account to another (In a different location). I'm using the following code: var sourceContainer = sourceClient.GetContainerReference(containerId); var sourceBlob = sourceContainer.GetBlockBlobReference(blobId); if (await sourceBlob.ExistsAsync().ConfigureAwait(false)) { var targetContainer = targetClient.GetContainerReference(containerId); await targetContainer.CreateIfNotExistsAsync().ConfigureAwait(false); var targetBlob = targetContainer.GetBlockBlobReference(blobId); await targetBlob.DeleteIfExistsAsync().ConfigureAwait(false); await targetBlob

Download blob storage and return Json object

我与影子孤独终老i 提交于 2019-12-03 15:42:06
I am trying to download a .json blob that I have stored in a container in the Azure Storage using Newtonsoft.Json to write it to an object. I am doing this by calling: (CloudBlockBlob) blob.DownloadToStream(stream); However, instead of writing the stream to a file in the local app directory, I want to return the json object doing Json(result) This is what I have tried: using (var stream = new MemoryStream()) { blob.DownloadToStream(stream); var serializer = new JsonSerializer(); using (var sr = new StreamReader(stream)) { using (var jsonTextReader = new JsonTextReader(sr)) { result =

Getting started with Azure storage: Blobs vs Tables vs SQL Azure

ⅰ亾dé卋堺 提交于 2019-12-03 14:38:20
问题 It's quite a topic, blobs vs tables vs SQL , and despite all I read so far I still can't find some proper reasoning on what to use when. We have a multi-tenant SaaS web-application which we are about to move to Azure. We use an SQL Server 2008 database. We store documents and log information that belongs to the documents. Kinda like dropbox does. The forums state that you better use Azure Tables when you are considering "large" objects. We typically store hundreds of documents per user where

Azure storage block blob upload from android example

£可爱£侵袭症+ 提交于 2019-12-03 14:02:37
问题 I am using the following code from an android application to upload a blob to Azure Blob Storage. Note: the sasUrl parameter below is a signed url acquired from my web service : // upload file to azure blob storage private static Boolean upload(String sasUrl, String filePath, String mimeType) { try { // Get the file data File file = new File(filePath); if (!file.exists()) { return false; } String absoluteFilePath = file.getAbsolutePath(); FileInputStream fis = new FileInputStream

Using Azure CDN with Shared Access Signatures

余生长醉 提交于 2019-12-03 13:12:14
问题 Im trying to incorporate Azure to store the majority of my files for an application. I want to upload these files to a private container and private blob in azure, and have those uploads copied through the Azure CDN to all of the other nodes (still as private containers and blobs). I then want my application to make a request to a stored blob, and give me the shared access signature link to the blob for a period of time. However, I want the link generated to be given for the closest