azure-storage-blobs

empty image from blob storage

↘锁芯ラ 提交于 2019-12-02 09:25:25
问题 This is how I try to upload an image to Azure blog storage, then upload an empty file located there. I try to upload this image here: CloudStorageAccount storageAccount = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(Accountname, KeyValue), true); // Create the blob client. CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); // Retrieve a reference to a container. CloudBlobContainer container = blobClient.GetContainerReference

Returning Azure BLOB from WCF service as a Stream - Do we need to close it?

不想你离开。 提交于 2019-12-02 09:08:57
I have a simple WCF service that exposes a REST endpoint, and fetches files from a BLOB container. The service returns the file as a stream. i stumbled this post about closing the stream after the response has been made : http://devdump.wordpress.com/2008/12/07/disposing-return-values/ This is my code: public class FileService { [OperationContract] [WebGet(UriTemplate = "{*url}")] public Stream ServeHttpRequest(string url) { var fileDir = Path.GetDirectoryName(url); var fileName = Path.GetFileName(url); var blobName = Path.Combine(fileDir, fileName); return getBlob(blobName); } private Stream

ARM Template containing config settings for web app

一世执手 提交于 2019-12-02 07:50:13
I am encountering strange behavior when deploying an ARM template. I have the following template: (Note that sasUrl value 'xxx' has a real, working value in my file) { "name": "[variables('webAppServiceName')]", "type": "Microsoft.Web/sites", "location": "[resourceGroup().location]", "apiVersion": "2016-08-01", "dependsOn": [ "[concat('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "tags": { "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]": "Resource", "displayName": "[variables('webAppServiceName')]

Azure diagnostics and WadLogsTable

眉间皱痕 提交于 2019-12-02 07:47:01
I deployed an application on Windows Azure, i activated the diagnostic monitor like follows : public override bool OnStart() { CloudStorageAccount account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=[xxxxxx];AccountKey=[xxxxxxx]"); var config = DiagnosticMonitor.GetDefaultInitialConfiguration(); config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information; config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D); DiagnosticMonitor.Start(account, config); return base.OnStart(); } My question is why the logs are not stored automatically in "WADLogsTable"

how to transfer file to azure blob storage in chunks without writing to file using python

最后都变了- 提交于 2019-12-02 07:40:17
I need to transfer files from google cloud storage to azure blob storage. Google gives a code snippet to download files to byte variable like so: # Get Payload Data req = client.objects().get_media( bucket=bucket_name, object=object_name, generation=generation) # optional # The BytesIO object may be replaced with any io.Base instance. fh = io.BytesIO() downloader = MediaIoBaseDownload(fh, req, chunksize=1024*1024) done = False while not done: status, done = downloader.next_chunk() if status: print 'Download %d%%.' % int(status.progress() * 100) print 'Download Complete!' print fh.getvalue() I

Need help downloading image from Azure Blobs using NodeJS

早过忘川 提交于 2019-12-02 06:30:29
问题 I got most of the code from the NodeJS Blob quickstart from azure, I am able to upload files including images successfully and I can see them in the azure storage dashboard just fine. But I can't seem to download them or get a URL to them and I need the url for my database so I can query it and use the url to retrieve the file. The download part of the code in the quickstart isnt so clear to me, it seems to be made for text as the upload is as well. If I go into my azure storage dashboard I

Tool or usage example to generate and view SAS (Shared Access Signatures) of both Azure Block Blob and Azure File Share

末鹿安然 提交于 2019-12-02 05:34:50
问题 I am looking for a tool or usage example to generate and view SAS (Shared Access Signatures) of both Azure Block Blob and Azure File Share. There are lots of examples for Block Blob and Containers but what about Azure File Share SAS examples or tools. 回答1: Ability to create Shared Access Signature on a File Service Share is announced in the latest version of REST API. You must use Storage Client Library 5.0.0 for that purpose. First, install this library from Nuget: Install-Package

Getting Storage Account Properties using Storage Services REST API

你说的曾经没有我的故事 提交于 2019-12-02 04:31:29
Is there a way to get properties of a storage account, specifically the kind of account - GPv1, GPv2 or blob storage, through an API in Storage Services? I came across https://msdn.microsoft.com/en-us/library/azure/ee460802.aspx but if possible, I would like to re-use the SharedKey authentication I use for the Blob Service APIs. In this page, https://docs.microsoft.com/en-us/rest/api/storageservices/ I found this: "All access to storage services takes place through the storage account. The storage account is the highest level of the namespace for accessing each of the fundamental services. It

Azure PUT Blob authentication fails in R

我们两清 提交于 2019-12-02 04:23:57
I would like to use R and the Azure Storage's Put Blob API to put files into my blob storage account but it fails to authenticate my request. Unfortunately, I couldn't find any documentation or sample code for R. General documentation of Put Blob API: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob Here is the code that I tried to use: library(httr) account <- "myAccount" container <- "myContainer" filename <- "test.txt" key <- "primaryKey" object <- "Hello World" url <- paste0("https://", account, ".blob.core.windows.net/", container, "/", filename) requestdate <- format

Azure Blob Storage | AcquireLeaseAsync, synchronously wait until lock is released

自作多情 提交于 2019-12-02 03:11:43
Right now I'm making a HTTP serverless function with Azure Functions and with that I need to make my incoming requests synchronous when accessing a single Blob Storage Item on my Storage Account. What I want to happen is the following: // Incoming Request 1 // .. Get blob await myBlob.AcquireLeaseAsync(TimeSpan.FromMinutes(1), leaseId); // .. 10 seconds later await myblob.ReleaseLeaseAsync(AccessCondition.GenerateEmptyCondition()); // // MEANWHILE // // Incoming Request 2 (Happens 1-2 seconds after Request 1) // .. Get blob // .. -- Wait until Lease is released from Request 1 -- await myBlob