azure-storage-blobs

Azure: Assign Roles via ARM Template to storage container

天涯浪子 提交于 2019-12-06 15:00:33
I'm trying to assign the role "Storage Blob Data Contributor (Preview)" to a specific storage container via arm template. But I just can't figure out the correct syntax. This is what I have: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "principalId": { "type": "string", "metadata": { "description": "The principal to assign the role to" } }, "builtInRoleType": { "type": "string", "allowedValues": [ "Contributor", "Reader", "StorageBlobDataContributor" ], "metadata": { "description": "Built-in role to

Azure Blob Not Storing PDFs

自闭症网瘾萝莉.ら 提交于 2019-12-06 14:57:00
Ok so i have the following code-- it works perfectly for storing jpgs, but does not store pdfs. Any idea why? public bool TryStoreImage(string uri, string fileName) { try { WebClient wc = new WebClient(); var blob = new BlobStorage().GetCloudBlobContainer(); var store = blob.GetBlobReference(fileName); store.UploadByteArray(wc.DownloadData(uri)); return true; } catch (Exception exc) { return false; } } ` Again, every pdf i try to access gives me "pdf does not exist," even though i can see the pdf in the azure management screen. Every jpg i store however is perfectly accessible. What do you

Write text to a file in Azure storage

末鹿安然 提交于 2019-12-06 14:02:24
问题 I have a text file uploaded in my Azure storage account.Now, in my worker role , what i need to do is every time it is run, it fetches some content from Database, and that content must be written in the Uploaded text file, specifically , each time the content of Text file should be overwritten with some new content. Here, they have given a way to upload a text file to your storage and also delete a file.But i don't want to do that, need to just MODIFY the already present text file each time.

Access blob file using time stamp in Azure

大城市里の小女人 提交于 2019-12-06 13:14:37
问题 I want to access a blob file that is getting generated out of azure ml web service along with the ilearner and csv file. The problem is that the file is getting generated automatically with guid as its name, and with no response mentioning the existence of that file. I know that the file is getting generated as i can access it through azure portal. i would like to automatically access the file and the only possibility i can see is by using the time stamp of other file created at the same

Cut videos from Azure Blob Storage

落花浮王杯 提交于 2019-12-06 12:28:36
I have a web app that is hosted in Azure; one of it's functionalities is to be able to make a few cuts from the video(generate 2 or 3 small videos of 5-10 seconds from a larger video). The videos are persisted in Azure Blob Storage. How do you suggest to accomplish this in the Azure environment? The actual cutting of the videos will be initiated by a web job. I'm also concerned about the pricing(within the Azure environment), I'm taking into account the possibility of high traffic. Any feedback is appreciated. Thank you. Assuming you have video-cutting code that operates on files through

RBAC access to Azure Storage - preview roles not acting as expected

元气小坏坏 提交于 2019-12-06 11:45:09
问题 I'm trying to give our operations team read-only access to a storage account containing log files. I'd like to be able to give them the right to enumerate containers and read blobs. Ideally that would be the extent of their access. There are a couple of RBAC roles in preview that looked promising: Storage Blob Data Reader (Preview) is described as "Allows for read access to Azure Storage blobs containers and data" which sounds exactly like what I'm after Storage Blob Data Contributor (Preview

Upload image to Azure blob storage from Windows Phone. Not creating

人走茶凉 提交于 2019-12-06 11:33:35
问题 I am using Windows Azure to store images in my windows phone application. The camera takes a photo and the chosen photo stream is then uploaded. However it is throwing NO error but is not uploading? var blobContainer = CloudStorageContext.Current.Resolver.CreateCloudBlobClient(); var container = blobContainer.GetContainerReference("pics"); var blob = container.GetBlobReference("picture.jpg"); blob.UploadFromStream(e.ChosenPhoto, response => { MessageBox.Show(blob.Uri.ToString()) }); I don't

Azure AppendBlob number of block/writes

被刻印的时光 ゝ 提交于 2019-12-06 11:33:31
I am using AppendBlob in Azure for logging. After some time I experienced 409 Conflict Error . My guess is the maximal amount of block/writes (50.000) was reached. Is there any way to get count of blocks/writes in the blob? In Azure Reference , you can find the table of Blob Service Error Codes which list the error codes may be returned by an operation against the Blob service includes Conflict 409 , please see below. The details for the maximums of AppendBlob , you can refer to the section About Append Blobs of the reference page Understanding Block Blobs, Append Blobs, and Page Blobs as

Uploading DataTable to Azure blob storage

烈酒焚心 提交于 2019-12-06 10:51:38
I am trying to serialize a DataTable to XML and then upload it to Azure blob storage. The below code works, but seems clunky and memory hungry. Is there a better way to do this? I'm especially referring to the fact that I am dumping a memory stream to a byte array and then creating a new memory stream from it. var container = blobClient.GetContainerReference("container"); var blockBlob = container.GetBlockBlobReference("blob"); byte[] blobBytes; using (var writeStream = new MemoryStream()) { using (var writer = new StreamWriter(writeStream)) { table.WriteXml(writer, XmlWriteMode.WriteSchema);

Force file download for IE9 on Azure Blob Storage

回眸只為那壹抹淺笑 提交于 2019-12-06 09:40:37
I am trying to use Azure Blob Storage as a location for secure file downloads using Shared Access Signature. Everything is working very well, however the problem I am having is I am trying to allow the user to save files from the browser and I have all browsers except IE9 working. Reviewing this question, What content type to force download of text response? this works well when I can control all of the headers, however in Azure Blob Storage, I have set the Content-Type to application/octet-stream and this allows all browsers except IE to ask the user to save the file, IE simply opens the file