File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed
Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -475,11 +475,13 @@ Invoke [azcopy copy](https://learn.microsoft.com/en-us/azure/storage/common/stor
475475command in pipeline.
476476
477477# ## Inputs
478- | Name | Description | Optional | Default value |
479- |---------|:-----------------------------------------------|----------|---------------|
480- | source | Source directory or SAS url to copy | False | |
481- | target | Target directory or SAS url | False | |
482- | put_md5 | If `true` sets `--put-md5` parameter to azcopy | True | True |
478+ | Name | Description | Optional | Default value |
479+ |--------------------|:-----------------------------------------------|----------|---------------|
480+ | source | Source directory or SAS url to copy | False | |
481+ | target | Target directory or SAS url | False | |
482+ | mode | azcopy action mode (copy or sync) | True | copy |
483+ | put_md5 | If `true` sets `--put-md5` parameter to azcopy | True | True |
484+ | delete_destination | azcopy --delete-destination flag | True | False |
483485
484486# ## Outputs
485487No outputs defined
@@ -522,6 +524,7 @@ for a file share, attached to a storage account.
522524| account_key | Name of the storage account of the share | False | |
523525| account_name | Key of the storage account of the share | False | |
524526| expiration_date | Expiration date in format that can be used by the `date` command | True | +10 minutes |
527+ | directory_type | Type of directory (blob or fileshare) | True | fileshare |
525528
526529
527530**NOTES**:
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ inputs:
2323 required : false
2424 default : " +10 minutes"
2525
26+ directory_type :
27+ description : Type of directory (blob or fileshare)
28+ required : false
29+ default : " fileshare"
2630
2731outputs :
2832 authorized_destination :
4044 ACCOUNT_KEY : ${{ inputs.account_key }}
4145 ACCOUNT_NAME : ${{ inputs.account_name }}
4246 EXPIRATION_DATE : ${{ inputs.expiration_date }}
47+ DIRECTORY_TYPE : ${{ inputs.directory_type }}
4348 id : sas
Original file line number Diff line number Diff line change 1616
1717set -Eeuo pipefail
1818
19- destination=" https://$ACCOUNT_NAME .file.core.windows.net/$DIRECTORY_NAME "
19+
20+ if [[ " $( echo " $DIRECTORY_TYPE " | tr ' [:upper:]' ' [:lower:]' ) " == ' fileshare' ]]; then
21+ destination=" https://$ACCOUNT_NAME .file.core.windows.net/$DIRECTORY_NAME "
22+ services=" f"
23+ elif [[ " $( echo " $DIRECTORY_TYPE " | tr ' [:upper:]' ' [:lower:]' ) " == ' blob' ]]; then
24+ destination=" https://$ACCOUNT_NAME .blob.core.windows.net/$DIRECTORY_NAME "
25+ services=" b"
26+ else
27+ echo " Directory type \" $DIRECTORY_TYPE \" not supported"
28+ exit 1;
29+ fi ;
30+
31+
2032
2133end=$( date -d " $EXPIRATION_DATE " ' +%Y-%m-%dT%H:%MZ' )
2234echo " Generating SAS for $destination with expiration date $end "
2840 --https-only \
2941 --permissions acdlpruw \
3042 --resource-types sco \
31- --services fb | cut -d' "' -f2
43+ --services " $services " | cut -d' "' -f2
3244)
3345
3446authorized_destination=" $destination ?$sas "
You can’t perform that action at this time.
0 commit comments