azure-storage-blobs

Programmatically get Azure storage account properties

守給你的承諾、 提交于 2019-12-06 01:54:16
I wrote in my C# web application a method that deletes old blobs from Azure storage account. This is my code: public void CleanupIotHubExpiredBlobs() { const string StorageAccountName = "storageName"; const string StorageAccountKey = "XXXXXXXXXX"; const string StorageContainerName = "outputblob"; string storageConnectionString = string.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", StorageAccountName, StorageAccountKey); // Retrieve storage account from connection string. CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString); // Create

Uploading Multiple Files to Azure Blob Storage

半世苍凉 提交于 2019-12-06 01:18:59
问题 Pretty new to Windows Azure. I've followed this tutorial: tutorial. It works perfectly however one limitation is that for the application I have in mind, it would need to be possible to upload multiple files relatively quickly. Is it possible to modify the tutorial to support multi-file uploads, e.g. The user can use shift-click to select multiple files.. Or if anyone knows of any good tutorials detailing the above? Any help is appreciated, Thanks 回答1: I'd take a look at this tutorial from

Azure Function Blob Trigger CloudBlockBlob binding

柔情痞子 提交于 2019-12-05 20:09:28
I have the following Azure function triggered when a file is uploaded to Blob Storage [FunctionName("ImageAnalysis")] public static async void Run( [BlobTrigger("imageanalysis/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob, string name, TraceWriter log) { log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes"); } I want to process the Blob that has been uploaded so ideally I would like it as a CloudBlockBlob instead of a Stream. Then I can just do some work and then delete the blob. myBlob.DeleteIfExists() Is there an easy way to cast or

How to resolve an InvalidMd5 error returned from the Windows Azure Blob Storage service?

萝らか妹 提交于 2019-12-05 19:55:09
I am building an application that needs to allow users to upload large images (up to about 100 MB) to the Windows Azure Blob Storage service. Having read Rob Gillen's excellent article on file upload optimization for Windows Azure, I borrowed his approach for doing parallel upload of file chunks, using the CloudBlockBlob.PutBlock() method within a Parallel.For loop (code is available here ). The problem I have is that whenever I try to upload a file I get an " InvalidMd5 " exception from the storage client . Suspecting that the problem may be in the development storage, I also tried running

Upload an image file to azure blob storage from js

*爱你&永不变心* 提交于 2019-12-05 18:37:37
I'm trying to upload an image file from an html page to azure blob storage. So far I have written a web service to create an SAS for my blob container. From this I have created a uri of the format "blob address" / "container name" / "blob name" ? "sas". I have an upload control on my html page. I have then tried to upload the file using the following code: var xhr = new XMLHttpRequest(); xhr.upload.addEventListener("progress", uploadProgress, false); xhr.addEventListener("load", uploadComplete, false); xhr.addEventListener("error", uploadFailed, false); xhr.addEventListener("abort",

How to access an object in Microsoft Azure Storage Service publicly?

六眼飞鱼酱① 提交于 2019-12-05 18:33:13
I would like to upload some images to be stored in Azure, I discovered that there is called 'Storage' in Blob, after doing some research I was able create my account in storage service and I'm accessing it with 'Azure Storage Explorer'. 1)There's another software that I could access my storage account ? Or another way to do it ? 2)What's the difference between 'public container' and 'public blob'? 3)I would like to create sub-folders, how can I do that ? 4)How can I make an image that I upload to the 'public blog' called 'image', been like this image\azure.png and be accessible from anyone in

How can I extract Last Modified Date in MS Azure for a blob in my blob storage

天涯浪子 提交于 2019-12-05 18:19:52
I am pretty new to the world of MS Azure. I am trying to get the filenames and the last modified date for a bunch of files (block blobs) kept in my blob storage using Python. Here is the code that I am using: import datetime from azure.storage.blob import BlockBlobService blob_service = BlockBlobService(account_name=account, account_key=acckey,protocol='http', request_session=sess) blob_service.get_blob_to_path(container, pdfname, pdflocal) generator = blob_service.list_blobs(container) filenames = [] for blob in generator: print (blob.name) pdflocal = './' + blob.name properties=blob_service

Azure, access denied on Shared Access Signature for Storage 2.0

你说的曾经没有我的故事 提交于 2019-12-05 16:20:15
I'm having trouble getting shared access signatures to work with Storage 2.0.. I use the code: if (blob.Exists()) { var expires = DateTime.UtcNow.AddMinutes(30); var sas = blob.GetSharedAccessSignature(new Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPolicy { Permissions = Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions.Read, SharedAccessExpiryTime = expires }); url = string.Concat(blob.Uri.AbsoluteUri, sas); } return url; But if I debug the session and paste the URL into a browser, I get an error: <Error> <Code>AuthenticationFailed</Code> <Message> Server failed to

Download all blobs files locally from azure container using python

非 Y 不嫁゛ 提交于 2019-12-05 16:01:12
I'm using python 3.6 in visual studio and I want to download all blobs files from my azure container in single folder. This is my code but the problem is, that it downloads 1 blob file in the folder and then when downloading the second file it overwrite the first file and in the end I only have the last blob in my local folder. How can I download all the blobs files at once in a single folder? from azure.storage.blob import BlockBlobService block_blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY) generator = block_blob_service.list_blobs(CONTAINER_NAME) for

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

主宰稳场 提交于 2019-12-05 15:04:17
问题 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? 回答1: 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