Accessing Azure storage with the AzCopy CLI
Install the AzCopy command line tool to access Azure storage in DataStage.
Before you begin
Procedure
-
Install the Azure CLI tool
az. Follow the instructions in How to install the Azure CLI, or if you are a root user on an RHEL sandbox, run the following command.curl -L https://aka.ms/InstallAzureCli | bash - Install AzCopy.
- Download the tool from Download AzCopy.
- Copy
azcopy_linux_amd64_x.x.x.tar.gzto/ds-storage/directory onds-px-default-ibm-datastage-px-runtime-xxx-xxxpod. - Extract the tar file
azcopy_linux_amd64_x.x.x.tar.gz. After that, you can see the "azcopy" and "NOTICE.txt" files in/ds-storage/azcopy_linux_amd64_x.x.x. - Add directory path to PATH variable by using following command:
export PATH=/ds-storage/azcopy_linux_amd64_x.x.x:$PATH
- To access Azure storage by using azcopy, you need a Shared Access Signature (SAS token).
- Set the required environment variables: AZURE_ACCOUNT_NAME, AZURE_ACCOUNT_KEY, AZURE_CONTAINER_NAME, AZURE_SAS_TOKEN before you access Azure storage account.
- Find scripts in
/opt/ibm/PXService/Azure on ds-px-default-ibm-datastage-px-runtime-xxx-xxxpod for performing operations on the Azure storage:- Use "list_objects.sh" to list files in the Azure storage.
- Use "azure_upload.sh" to export a local file to the Azure storage.
- Use "azure_download.sh" to download an object from the Azure storage to local disk.
- Use "azure_delete.sh" to delete an object from the Azure storage.