azure-blob-storage

Dowload zip file from blob with SAS link using azcopy

a 夏天 提交于 2021-01-29 08:45:57
问题 I try to download a zip file from blob using the SAS link in powershell. I use the exact syntax as mentioned here but I get the below error failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*) Below is the script .\azcopy.exe copy '<SAS link to file>' '<local file path>' I use AzCopy version 10.3.3 回答1: Your linking article contains example commands that work with Azure Files . However, you mentioned you want to download a

Copy an archived blob to an online tier

会有一股神秘感。 提交于 2021-01-28 09:21:38
问题 I need to copy a blob from archive tier to the hot tear in another container. If I'm using StartCopy method I'm getting "This operation is not permitted on an archived blob" error. Here is my code: CloudBlockBlob blobSource = (CloudBlockBlob)item; CloudBlockBlob blobTarget = ArchiveContainer.GetBlockBlobReference(blobSource.Name); blobTarget.StartCopy(blobSource); It should be possible to do based on this article, but I didn't find any code sample. Is it possible to do with Microsoft.Azure

How to upload a large string in an Azure Blob?

梦想的初衷 提交于 2021-01-28 08:16:37
问题 Right now I'm trying to figure out how to work with Azure, and now I'm stuck in a problem while storing my data in the storage account. I have three strings and want to store each of them in a separate blob. With the first two, my code works fine, but the third one causes some retries and ends with a timeout. My code is running within an Azure function. Here is a minimal example: from azure.storage.blob import BlobClient blob_client = BlobClient.from_connection_string( conn_str. = '<STORAGE

Selectively deleting images uploaded to Azure blob (Django/Python project)

岁酱吖の 提交于 2021-01-28 00:57:30
问题 In a Django (Python) project, I'm using Azure blobs to store photos uploaded by users. The code simply goes something like this: from azure.storage.blob import BlobService blob_service = BlobService(account_name=accountName, account_key=accountKey) blob_service.put_blob( 'pictures', name, # including folder content_str, # image as stream x_ms_blob_type='BlockBlob', x_ms_blob_content_type=content_type, x_ms_blob_cache_control ='public, max-age=3600, s-maxage=86400' ) My question is: what's the

Using service principal to access Azure blob storage

感情迁移 提交于 2021-01-27 12:07:56
问题 I want to access a private blob store, from python, by using credentials from an active directory service principal. I am aware of this related question How do I authenticate a user against an Azure storage blob in python? This has helped me get this far but now I'm stuck. I can authenticate and get a token which let me list containers, create new containers, but will not let me list or access any blobs. I wish to set this up via the az cli. Service principal has been set up like so: az ad sp

Upload multiple files from folder to Azure Blob storage using Azure Storage SDK for Python

大城市里の小女人 提交于 2021-01-27 11:40:00
问题 I have some images in a local folder on my windows machine. I want to upload all images to the same blob in the same container. I know how to upload a single file with Azure Storage SDKs BlockBlobService.create_blob_from_path() , but I do not see a possibility to upload all images in the folder at once. However, the Azure Storage Explorer provides a functionality for this, so it must be possible somehow. Is there a function providing this service or do I have to loop over all files in a

Azure CDN Premium Verizon Rules Engine V4 URL Rewrite for Storage Static Website sub directories

核能气质少年 提交于 2021-01-27 07:52:50
问题 I'm trying to host an Angular project with Azure Storage Static Website through Azure CDN Verizon Premium Let's say i have containers for each Angular builds named like v0.3.13.3 and in that container there are also multi language builds of angular project. What i'm trying to achieve is to serve the right index.html with correct routing for each version and language. You may find example routes below: my.domain.com/v0.3.13.3 should serve /v0.3.13.3/index.html my.domain.com/v0.3.13.3/dashboard

Set content type when uploading to Azure Blob Storage

我的未来我决定 提交于 2021-01-23 06:21:45
问题 I am uploading a static site using the Azure Blob storage client library. blob_service_client = BlobServiceClient.from_connection_string(az_string) blob_client = blob_service_client.get_blob_client(container=container_name, blob=local_file_name) print("\nUploading to Azure Storage as blob:\n\t" + local_file_name) with open('populated.html', "rb") as data: test = blob_client.upload_blob(data, overwrite=True) This is working but the HTML file is downloading instead of displaying. This is

Is there any way of writing file to Azure Blob Storage directly from C# application?

元气小坏坏 提交于 2021-01-21 10:36:27
问题 I am trying to create a new C# console application that writes into the blob storage directly from the code. I am able to create a local file and upload it to the blob. But the requirement is writing the content directly to blob instead of creating a file and uploading to Blob.I am not being able to achieve this. I searched for the related web resources but couldn't find anything that would help in this issue. I am looking for suggestions/help. 回答1: It's actually pretty straight forward. See

What is Azure Lease Blob?

让人想犯罪 __ 提交于 2020-12-02 06:27:22
问题 What is Azure Lease Blob? Is it just a mechanism which provides an exclusive lock to the blob storage? What is special about it? Where can I use it? I tried to read Azure documents, but it's not clear to me yet. 回答1: What is Azure Lease Blob? Is it just a mechanism which provides an exclusive lock to the blob storage? Your understanding is correct. When you lease a blob, you acquire an exclusive lock on that blob. As long as the blob is leased, no one other than lease holder can modify or