I need to create a SAS token for a container using PowerShell with an expiry date one year from now. If I use New-AzStorageContainerSASToken I cannot set an expiry date after 7 days because it uses a user delegation key.
For example, if I do this:
$container = New-AzStorageContainer -Name $saName -Context $backupContext
$token = $container | New-AzStorageContainerSASToken -Permission rwdl -ExpiryTime (Get-Date).AddYears(1)
I get error
New-AzStorageContainerSASToken: Generate User Delegation SAS with OAuth bases Storage context. User Delegate Key expiry time 20/07/2023 15:46:12 +00:00 must be in 7 days from now.
How can I specify to sign with the account key instead?