I am new to Azure and I get 150 CSV files everyday through SFTP into blob storage and they are stored in separate containers everyday. The containers are numbered as 0000,00001,00002 with daily files. How do I load the files from the latest folder into azure data warehouse. How do I point the copy activity to point to the latest folder dynamically. What is the best way to do it? Many thanks for your help.
1 Answers
0
votes
Unfortunately there's no direct way to find the latest blob container.
Considering a new blob container is created each day and the blob container name is in sequential order, only way to find the latest blob container is to list all blob containers in the storage account, either take the last blob container in the result set or sort the result in descending order and take the first one to find the latest blob container.
There's a Last Modified Date property on a blob container but again this changes any time the blob container is changed so you can't really use it reliably to find the latest blob container. Again for this you would need to list the blob containers (you simply can't avoid this step).
0000will the name of the container created tomorrow be0001? Or it could be completely random? - Gaurav Mantri