azure-storage-blobs

Getting null value for Azure blob last modified property

大城市里の小女人 提交于 2019-12-01 09:56:06
问题 I'm getting null when I'm trying to fetch LastModified property of Azure Blob, below is the snippet for the same. CloudStorageAccount storageAccount = CloudStorageAccount.Parse("account"); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference("folder"); var blobs = container.ListBlobs(); foreach (var blob in blobs) { CloudBlockBlob blockBlob =container.GetBlockBlobReference(blob.ToString()); var timemodified =

Windows azure REST API to List containers issue

こ雲淡風輕ζ 提交于 2019-12-01 09:51:33
问题 I'm trying to list the containers in my windows azure storage account. but i'm struck with an exception "The remote server returned an error: (403) Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.." But i have included the signature as per the instructions given, do any one find any mistake in my code ? private static String SignThis(string StringToSign,string Key,string Account) { String signature = string

Transfer file from Azure Blob Storage to Google Cloud Storage programmatically

安稳与你 提交于 2019-12-01 08:32:56
I have a number of files that I transferred into Azure Blob Storage via the Azure Data Factory. Unfortunately, this tool doesn't appear to set the Content-MD5 value for any of the values, so when I pull that value from the Blob Storage API, it's empty. I'm aiming to transfer these files out of Azure Blob Storage and into Google Storage. The documentation I'm seeing for Google's Storagetransfer service at https://cloud.google.com/storage/transfer/reference/rest/v1/TransferSpec#HttpData indicates that I can easily initiate such a transfer if I supply a list of the files with their URL, length in

Mock CloudBlobClient with AutoFac and AutoMock

為{幸葍}努か 提交于 2019-12-01 08:28:50
I'm trying to write unit tests for my AzureBlobRepository. The repository receives a CloubBlobClient in the constructor. I want to mock the client, but this gives an exception: using (var mock = AutoMock.GetLoose()) { var mockClient = mock.Mock<CloudBlobClient>(); } Cannot choose between multiple constructors with equal length 2 on type 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered. Ofcourse, in my unit test I am not registering anything, so that message is not very

PowerShell script error: the string is missing the terminator:

房东的猫 提交于 2019-12-01 08:23:11
Incredibly simple powershell script... #Server side storage copy $SourceStorageAccount = "myStorageAccount" $SourceStorageKey = "myKey" $SourceStorageContext = New-AzureStorageContext –StorageAccountName $SourceStorageAccount -StorageAccountKey $SourceStorageKey fails with the error At E:\DeploymentScripts\Storage\Test.ps1:6 char:51 + ... geContext –StorageAccountName $SourceStorageAccount -StorageAccount ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The string is missing the terminator: ". + CategoryInfo : ParserError: (:) [], ParseException + FullyQualifiedErrorId :

Unable to copy blobs from one container to another

喜夏-厌秋 提交于 2019-12-01 08:14:09
I am creating a console app that copies all blobs in all containers from an account we use for production to another we use for development. I have the following method to do this. The 'productionStorage' and 'developmentStorage' objects are in another assembly where Azure storage client methods are housed. static void CopyBlobsToDevelopment() { // Get a list of containers in production List<CloudBlobContainer> productionBlobContainers = productionStorage.GetContainerList(); // For each container in production... foreach (var productionContainer in productionBlobContainers) { // Get a list of

If using ImageResizer with Azure blobs do I need the AzureReader2 plugin?

青春壹個敷衍的年華 提交于 2019-12-01 08:01:33
I'm working on a personal project to manage users of my club, it's hosted on the free Azure package (for now at least), partly as an experiment to try out Azure. Part of creating their records is to add a photo, so I've got a Contact Card view that lets me see who they are, when they came and a photo. I have installed ImageResizer and it's really easy to resize the 10MP photos from my camera and save them to the file system locally, but it seems that for Azure I need to use their Blobs to Upload Pictures to Windows Azure Web Sites , and that's new to me. The documentation on ImageResizer says

Storing binary data (images, files, etc) using WPF + Windows Azure

别等时光非礼了梦想. 提交于 2019-12-01 07:49:02
问题 I have a WPF application that uses Windows Azure as the backend. I use SQL Azure to store data that are accessed by the WPF application through a WCF service. I need to be able to store binary files (e.g. images) server-side and wonder what the best way to store these files are. I can put the files in the SQL database but I'm not sure if this is recommended. Lets assume about 2000 files are to stored (total size of ~1GB). These files are accessed frequently (preferably cached on the client).

Error binding Blob to IAsyncCollector when binding to output blob in Async method

梦想的初衷 提交于 2019-12-01 07:35:06
问题 I'm trying to bind to a blob output in an Async method following this post: How can I bind output values to my async Azure Function? I have multiple output bindings so just returning is not an option public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, IAsyncCollector<string> collection, TraceWriter log) { if (req.Method == HttpMethod.Post) { string jsonContent = await req.Content.ReadAsStringAsync(); // Save to blob await collection.AddAsync(jsonContent); return req

Mock CloudBlobClient with AutoFac and AutoMock

余生颓废 提交于 2019-12-01 07:30:18
问题 I'm trying to write unit tests for my AzureBlobRepository. The repository receives a CloubBlobClient in the constructor. I want to mock the client, but this gives an exception: using (var mock = AutoMock.GetLoose()) { var mockClient = mock.Mock<CloudBlobClient>(); } Cannot choose between multiple constructors with equal length 2 on type 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component