Codebase to validate connectivity to external systems
This is a piece of java code to check the access connectivity from a given machine to the adls gen2 storage account.
What script does?:
- Tests if the folder creation/deletion works fine.
- Tests if the file upload to folder works fine.
- Tests if the listing of folder works fine.
$ java -cp ./out/artifacts/AzureADLSGen2ConnectivityTest_jar/AzureADLSGen2ConnectivityTest.jar
abcd.adls.ADLSClientConnector
--account_name <adls_gen2_storage_account_name>
--container_name <storage_container_name>
--auth_type account_key
--account_key <your_storage_account_key>
$ java -cp ./out/artifacts/AzureADLSGen2ConnectivityTest_jar/AzureADLSGen2ConnectivityTest.jar
abcd.adls.ADLSClientConnector
--account_name <adls_gen2_storage_account_name>
--auth_type service_principal
--tenant_id <Azure tenant/directory ID>
--client_id <Azure Client App ID>
--client_secret <Azure Client Secret>
$ Creating directory under the container
Successfully created/overwrote the iwx_test_connectivity directory under the given container!
Trying to upload a sample file to container csv-test...
Creation of sample file succeeded!
Trying to list the directory contents csv-test...
PathName: iwx_test_connectivity/sample.txt
Done Listing!
Trying to remove a sample file from the container csv-test...
Sample file deletion succeeded!
Trying to remove the iwx_test_connectivity directory from the container csv-test...
Directory iwx_test_connectivity deletion succeeded!
Testing Complete!
Process finished with exit code 0