3636 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3737 - uses : actions/checkout@v2
3838
39+ - name : Find test files
40+ run : |
41+ find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read filename; do
42+ echo "$filename"
43+ relativePath=$(echo "$filename" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests//g')
44+ echo "$relativePath"
45+ done
46+
3947
4048 # Build and run the unit tests
4149 - name : Setup .NET
@@ -160,6 +168,7 @@ jobs:
160168 echo "Deployment Outputs"
161169 #echo "::set-output name=STORAGE_ACCOUNTCONNECTION_STRING::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountConnectionString.value')"
162170 echo "::set-output name=STORAGE_ACCOUNT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageAccountName.value')"
171+ echo "::set-output name=STORAGE_CONTAINER_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.storageContainerName.value')"
163172 echo "::set-output name=FUNCTIONS_APP_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppName.value')"
164173 echo "::set-output name=FUNCTIONS_APP_URI::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.functionsAppUri.value')"
165174 echo "::set-output name=KEY_VAULT_NAME::$(echo $DEPLOYMENTOUTPUT | jq --raw-output '.keyVaultName.value')"
@@ -180,6 +189,7 @@ jobs:
180189 #echo "FUNCTIONS_APP_KEY: ${{ steps.create-devtest-labs-environment.outputs.FUNCTIONS_APP_KEY }}"
181190 #echo "STORAGE_ACCOUNTCONNECTION_STRING: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNTCONNECTION_STRING }}"
182191 echo "STORAGE_ACCOUNT_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
192+ echo "STORAGE_CONTAINER_NAME: ${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
183193 echo "KEY_VAULT_NAME: ${{ steps.create-devtest-labs-environment.outputs.KEY_VAULT_NAME }}"
184194 echo 'RUN_SETTINGS: ${{ steps.create-devtest-labs-environment.outputs.RUN_SETTINGS }}'
185195
@@ -229,11 +239,22 @@ jobs:
229239 uses : kheiakiyama/install-azcopy-action@v1.0.3
230240 with :
231241 version : ' v10'
242+ creds : ' ${{ secrets.AZURE_DEV_TEST_LABS_CREDENTIALS }}'
232243
233244 - name : Copy files to Azure Data Lake using AZCopy
234245 run : |
235- ls -ltA
236- # azcopy_v10 --source {SOURCE} --destination {DEST} --dest-key ${{ secrets.STORAGE_KEY }} --recursive --set-content-type
246+
247+ STORAGE_ACCOUNT_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_ACCOUNT_NAME }}"
248+ STORAGE_CONTAINER_NAME="${{ steps.create-devtest-labs-environment.outputs.STORAGE_CONTAINER_NAME }}"
249+ # The exclude patter for the .keepDirectory files is not working, so workaround below if to find these files and remove them from ADLS
250+ azcopy copy "./DataPipelineTools.Functions.Tests/TestData" "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME" --recursive=true --exclude-pattern=".keepDirectory"
251+
252+ # Remove the .keepDirectory files, these are just used to allow us to add empty folders into the sample data in Git
253+ find ./DataPipelineTools.Functions.Tests/TestData -type f -name ".keepFolder"|while IFS=/ read FILENAME; do
254+ RELATIVE_PATH=$(echo "$FILENAME" | sed -r 's/\.\/DataPipelineTools\.Functions\.Tests\///g')
255+ azcopy rm "https://$STORAGE_ACCOUNT_NAME.dfs.core.windows.net/$STORAGE_CONTAINER_NAME/$RELATIVE_PATH"
256+ done
257+
237258
238259 - name : ' Deploy Azure Functions to Lab Environment using RBAC'
239260 uses : Azure/functions-action@v1
0 commit comments