When I have Azure do a CloudBlockBlob.StartCopyAsync(), is there a way to have it verify a checksum? - azure-blob-storage

When I initiate an async copy of a block blob to another storage account using StartCopyAsync, is Azure doing any kind of integrity check for me, or if not, is there a way to have it do so?
I found that I can set the Properties.ContentMD5 property and have the integrity verified when uploading blobs. Is it also verifying during a copy operation?
I searched through the docs and found no mention of an integrity check during an async copy specifically. I found a couple references to AzCopy making integrity checks, and it also has the /CheckMD5 option, which is essentially what I'd like Azure to do after the blob copy.

As far as I know, the azure blob SDK is the package of the azure blob rest api.
So the azure SDK StartCopyAsync method will use copy operation(rest api) send to the azure server side to tell the server copy.
According to the copy operation article, you could find "When a blob is copied, the following system properties are copied to the destination blob with the same values".
It contains the "Content-MD5" property.

Related

SurrealDB - store binary files

Is it possible to store binary files (e.g. images) using SurrealDB?
I can't find anything about this in docs.
If not, where can I store images since all the other data is stored in SurrealDB.
SurrealDB wasn't created as a file store. For this purpose, you can use for example object storage. Nearly every cloud service provide object storage.
If you want an open-source solution that can host on your own, you can check MinIO object storage - github repo.

How can I restrict users from downloading the blobs into their machines?

I gave access to few of my colleagues on one of my Azure storage Account (Contributor).
The idea is to have them access (read and list) the data in the blob container, but I want to restrict them from downloading the data.
I tried the below:
Using SAS key with read and list still allowing them to download the blobs (Using Storage Explorer).
Giving them just reader access and "Storage blob data reader" access did not stop them from downloading the data.
Changing the blob access tier to "Archive" is not a solution that suites.
Tried creating a custom role, but failing to find the exact allow and disallow permissions.
I see the similar kind of question before but wasn't been answered yet # Restrict from downloading file on Azure Blob
Can you please help.
If a user has read permission on a blob (either through SAS Token or Azure AD role), they will be able to download the blob.
To prevent users from downloading a blob, remove read permissions on the blob for the users. For example if you are using a SAS Token, simply use List permissions there. Then the users will be able to see the list of the blobs but will not be able to download it.

Experiments with azure blob storage

Good day , I'm new in azure blob and don't know what kinds of experiments can be done with it, I have searched about it but still isn't clear to me. I'll be really gratefull if you can tell me about easy experiments that can be done in azure blob.
Blob storage stores unstructured data such as text, binary data, documents or media files.
Hope you meant the samples or the operations that can be done using azure blob when you say experiments.
You can do operations like uploading the files, downloading , listing etc. programmatically or through the UI.
You can above operations using languages such as .Net, Java,Python,JS..etc which you can find links in this documentation Azure Storage samples
But to access Azure Storage, you'll need an Azure subscription or free trial account. All access to Azure Storage takes place through a storage account. For this quickstart, create a storage account using the Azure portal.
Refer to Create a storage account
You can do above operations in portal directly .This sample blog can give you quick insights to perform them through portal.
A number of solutions exist for migrating existing data to Blob storage like AzCopy ,Azure datafactory etc
Introduction to Blob (object) storage - Azure Storage | Microsoft Docs

How to get a file after uploading it to Azure Storage

I had uploaded files mostly media files to Azure's File Storage, which I am able to see in Azure's Explorer as well. But when I view the file as anonymous user, I am not able to view the file. Tried to check with Permissions setting as well, but to no avail.
Any help would be welcomed :)
Azure files have Shared Access Signatures (SAS). This is a key that you compute with the storage account key, that gives access to a particular URL. Here is an example (storage account name is obfuscated here):
https://mystorageaccount.file.core.windows.net/sampleshare/2.png?sv=2015-04-05&sr=f&si=sampleread&sig=Zq%2BfflhhbAU4CkCuz9q%2BnUFEM%2Fsg2PbXe3L4MeCC9Bo%3D&sip=0.0.0.0-255.255.255.255
You have sample code on how to create a SAS with Azure files at https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/, ยง"Generate a shared access signature for a file or file share".
You can also do it interactively with a number of tools. For instance, CloudXPlorer has this feature.

Local file blob save

I am a bit stuck with this Windows Azure Blob storage.
I have a controller that receive a file path (local).
So on the web page I do something loke this:
http:...?filepath=C:/temp/myfile.txt
On the web service I want to get this file and put it on the blob service. When I launch it in local there is no problem but when i publish it there is no way to get the file. I always get:
Error encountered: Could not find a part of the path 'C:/temp/myfile.txt'.
Can someone help me. Is there a solution ?
First i would say to get proper help you would need to provide better description about your problem. What do you mean by "On the web service"? Is it a WCF web role which seems to match with your partial problem description. However most of the web service use http://whatever.cloudapp.net/whatever.svc as well as http://whatever.cloudapp.net/whaterever.aspx?whatever if added. Have you done something like that in your application.
You have also mentioned the controller in your code which makes me think it is a MVC based Web Role application.
I am writing above information to help you to formulate your question much better next time.
Finally Based on what you have provided you are reading a file from local file system (C:\temp\myfile.txt) and uploading to Azure Blob. This will work in compute Emulator and sure will fail in Windows Azure because:
In your Web Role code you will not have access to write on C:\ drive and that's why file is not there and you get error. Your best bet is to use Azure Local Storage to write any content there and then use Local Storage to read the file and then upload the Azure Blob. Azure Local storage is designed to write any content from web role (you will have write permission).
Finally, I am concern with your application design also because Azure VM are no persisted so having a solution to write to anywhere in VM is not good and you may need to directly write to Azure storage without using system memory, if that is possible anyways.
Did you verify the file exists on the Azure server?

Resources