Created
November 12, 2020 16:08
-
-
Save The-Running-Dev/370286f80ba05ca47c309fc499d5f541 to your computer and use it in GitHub Desktop.
Azure YAML task for generating a SAS token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- task: AzureCLI@2 | |
name: generateToken | |
displayName: Generating SAS Token | |
inputs: | |
azureSubscription: ${{variables.subscription}} | |
scriptType: pscore | |
scriptLocation: inlineScript | |
inlineScript: | | |
$sasToken = az storage blob generate-sas ` | |
--account-name ${{variables.templateStorageAccount}} ` | |
--container-name ${{variables.templateStorageContainer}} ` | |
--name ${{variables.nestedWebAppTemplate}} ` | |
--permissions r ` | |
--expiry $(Get-Date).AddMinutes(5).ToString("yyyy-MM-ddTHH:mmZ") ` | |
--https-only ` | |
--output tsv | |
Write-Output "##vso[task.setvariable variable=SASToken;isOutput=true]$sasToken" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment