I need to create, upload and copy 100 blobs from one account storage to second with python script.
`
import os, uuid
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient, __version__
#connect_str1 = os.getenv('AZURE_STORAGE_CONNECTION_STRING1')
connect_str2 ="DefaultEndpointsProtocol=https;AccountName=arielstorageaccount2;AccountKey=n+Bx[...]Q==;EndpointSuffix=core.windows.net"
#blob_service_client = BlobServiceClient.from_connection_string(connect_str)
blob_service_client2 = BlobServiceClient.from_connection_string(connect_str2)
# Create a unique name for the container
#container_name = str(uuid.uuid4())
container_name2 = str(uuid.uuid4())
# Create the container
#container_client = blob_service_client.create_container(container_name)
container_client2 = blob_service_client2.create_container(container_name2)
local_path = r"C:\Users\pavel\PycharmProjects\pythonProject1\data"
os.mkdir(local_path)
# Create a file in the local data directory to upload and download
for i in range(100):
local_file_name = str(uuid.uuid4()) + ".txt"
upload_file_path = os.path.join(local_path, local_file_name)
cwd = os.getcwd()
print(cwd)
# Write text to the file
file = open(upload_file_path, 'w')
file.write("Hello, World!")
file.close()
# Create a blob client using the local file name as the name for the blob
blob_client = blob_service_client2.get_blob_client(container=container_name2, blob=local_file_name)
print("\nUploading to Azure Storage as blob:\n\t" + local_file_name)
# Upload the created file
with open(upload_file_path, "rb") as data:
blob_client.upload_blob(data)
`
I have a few problems : 1. It does create new containers but not upload BLOBS 2. The code doesn't do the loop 100 times 3. don't understand how to copy the BLOB from one account storage to another



The code doesn't do the loop 100 times- How many times does it loop? Do you see files created locally?