https://pulumi.com logo
Title
m

modern-toothbrush-56347

07/24/2021, 10:04 AM
Hi everyone, I'm just getting started with Pulumi and have hit a snag. I need to generate an SAS token for a Blob in an Azure storage container, but can't see anything in the "Azure Native" namespace to do it. I notice "Azure Classic" has methods to create a SAS token for the storage account or the container but nothing for an individual blob object. I'm also not sure whether we are supposed to still be using the "Azure Classic" package or whether everything should be done with "Azure Native" from now on? Either way I can't find anything that will do what I want. Any ideas anyone? TIA
b

brave-planet-10645

07/24/2021, 1:19 PM
You can list the SAS using this method https://www.pulumi.com/docs/reference/pkg/azure-native/storage/liststorageaccountsas/ and then filter them so you get the one you want. Does that help?
m

modern-toothbrush-56347

07/24/2021, 2:03 PM
Thanks Piers, does this method get a list of existing SAS URL's or generate new ones?
I've uploaded a file into a blob and want to generate a SAS URL for the blob, like you can do manually in the Azure Portal
b

brave-planet-10645

07/24/2021, 2:15 PM
It lists the existing ones
Looking at the docs it doesn't look like one can be created using Pulumi. I'm assuming that there's no endpoint in ARM for it
m

modern-toothbrush-56347

07/24/2021, 4:52 PM
Looking into the ARM templates a bit further, it would appear that "ListAccountSas" is the thing that actually generates the SAS token (despite it being called 'list'). I found a few examples: https://samcogan.com/generate-sas-tokens-in-arm-teamplates/ https://michaelcollier.wordpress.com/2018/11/08/using-shared-access-signatures-in-azure-templates/ Maybe I'll try that and see how that goes. Thanks again