Open ma3yta opened 3 years ago
@Ma3yTa is this then using ARM as a way to generate SAS tokens?
@isaacabraham yes. we can submit a variable in the ARM template as follows:
"variables": {
"serviceSasFunctionValues": {
"canonicalizedResource": "[concat('/blob/', parameters('storageAccountName'), '/', parameters('containerName'))]",
"signedResource": "c",
"signedPermission": "rwac",
"signedExpiry": "2050-01-01T00:00:00Z"
}
}
and use an expression to get the SAS token in the output:
"outputs": {
"serviceSas": {
"type": "string",
"value": "[listServiceSas(parameters('storageAccountName'), '2018-02-01', variables('serviceSasFunctionValues')).serviceSasToken]"
}
}
output result:
"outputs": {
"serviceSas": {
"type": "String",
"value": "sv=2015-04-05&sr=c&se=2050-01-01T00%3A00%3A00.0000000Z&sp=r&sig=Eq%2BJlx6le6SrFKEEd8s73OyS1Ur39pzXZRn6GJ1p6fM%3D"
}
}
Articles about the subject
Example: