Hello, quick question on getting the azure blob sa...
# general
n
Hello, quick question on getting the azure blob sas token. Is it possible to configure the expiry_time dynamically (like 1 day orfew hours based on start time)?
Copy code
storage.list_storage_account_service_sas_output(account_name=account_name,
                                                           resource_group_name=resource_group_name,
                                                           permissions=storage.Permissions.R,
                                                           shared_access_start_time="2022-01-01T02:02:20Z",
                                                           shared_access_expiry_time="2025-01-01T02:02:20Z",
                                                           protocols=storage.HttpProtocol.HTTPS,
                                                           resource=storage.SignedResource.B,
                                                           canonicalized_resource=pulumi.Output.concat("/blob/",account_name,"/",container_name))
Right now, I have hard coded the
shared_access_expirty_time
.
m
Hey @nice-application-79035, it doesn’t seem like the API supports this directly. But you can create the start time as a
datetime
in your code, calculate the expiry time from that, and serialize both to a string. I’m not very fluent in Python but this page should have the docs: https://docs.python.org/3/library/datetime.html#timedelta-objects