locked
Hi All,Updating Azure Storage blob properties gives error. RRS feed

  • Question

  • Hi All,Updating Azure Storage blob properties gives error.

    I tried the below code but always get an error as "Parameter is incorrect", can you please tell me whats wrong  with the code?

     CloudStorageAccount storageAccount = CloudStorageAccount.Parse("xxxxxxxxxxxxxxxxxxxxxxx");
    
                    // Create the blob client.
                    CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
    
                    // Retrieve reference to a previously created container.
                    //CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
                    CloudBlobContainer container = blobClient.GetContainerReference("bpglobe");
    
                    CloudBlockBlob blockBlob = container.GetBlockBlobReference(@"23_S_America\01_Present_Day_GDE_Maps\Local_Maps\Colombia_Lanos region_GDEs_1999.pdf");
                    blockBlob.Properties. ContentType = "application/pdf";
    
    Sunday, October 21, 2018 11:32 PM

All replies

  • Hi,

    I'm not sure if it is a copy and paste error in your post, but I can see that you are missing a closing quote (") and semicolon (;) when setting the property for blockBlob.Properties.CacheControl

    Is your code also missing this?

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click Here

    • Proposed as answer by robrien-MSFT Monday, October 29, 2018 7:26 AM
    Monday, October 22, 2018 1:51 PM