Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/19/2024 06:42 AM
i am trying to upload Analytics report to Azure server getting errorr " target_dir does not exist. target_dir :sftpone1/testcontainter/, Refer connectorms logs for troubleshooting "
json that i am using
[
{
"eic_src_dir": "Reports",
"target_dir":"sftpone1/testcontainter/",
"file_list": ["SFTPGOUTAM.csv", "SFTPGOUTAM.xlsx", "SFTPGOUTAM.zip"],
"regex_list": ["^.*\\.zip", "^.*\\.csv"]
}
]
job error
azure path
container path "https://sftpone1.blob.core.windows.net/testcontainter"
06/19/2024 06:47 AM
Does container path is correct ?
validate using azure sdk
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
# Connection string to your Azure Blob Storage
connection_string = "your_connection_string"
container_name = "testcontainter"
# Initialize the BlobServiceClient
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
# Initialize the ContainerClient
container_client = blob_service_client.get_container_client(container_name)
# List of files to upload
files_to_upload = ["SFTPGOUTAM.csv", "SFTPGOUTAM.xlsx", "SFTPGOUTAM.zip"]
# Upload files to the container
for file_name in files_to_upload:
blob_client = container_client.get_blob_client(file_name)
with open(file_name, "rb") as data:
blob_client.upload_blob(data, overwrite=True)
print(f"{file_name} uploaded successfully to {container_name}.")
# Verify the files uploaded
blobs = container_client.list_blobs()
for blob in blobs:
print(blob.name)