def upload_directory_to_blob(upload_file_path, target): #directory name -> directory name print("\nUploading directory to Azure Storage as blob:\n\t" + upload_file_path) files = os.listdir(upload_file_path) for dir in files: file_name = upload_file_path + '/' + dir target_ = target+ '/' + dir blob_client = blob_service_client.get_blob_client(container=container_name, blob=target_) with open(file_name, "rb") as data: blob_client.upload_blob(data)