-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_storage_account_blob_container_sas token not the same format as token from Azure Portal (includes magic) #19828
Comments
@ajostergaard I find the only difference between the data source's output and the Portal's is the |
@magodo the provider output also encodes the colons in the time which the portal does not. I understand the motivation but to be blunt, the right way to make it easier is to make it explicit - and in this case, provide access to the Blob SAS URL for that use case. In my case I need that string as is from the portal and have to undo the magic. Doesn't matter now that it's done but I wasted a good amount of time figuring out why this simple think didn't work and would not wish that on others. |
@magodo this is, at the very least, a documentation bug but one way or another it's a bug - gone are the days of undocumented features. :) |
@magodo thanks for taking a look at this - can't we do the whole lot though? I mean either remove the question mark and provide the URL or document that unlike the portal (and I assume the CLI and the API) this provider adds a question mark. |
@ajostergaard We can mention it in the document once above PR got merged. Whilst we can't simply remove the question mark as it is a breaking change. |
@magodo fair enough, thanks. What about adding the full URL? |
@ajostergaard The full URL should be easily constructed manually, so I'm not gonna do the change. Since #21725 is merged that upgrades the go-azure-helpers to v0.56.0, so I'm gonna close this issue as the fix is in. Please feel free to reopen it if the issue remains. |
This resource is too problematic. I solved my issue by not using the "azurerm_storage_account_blob_container_sas" resource, but rather "azurerm_storage_account_sas" instead. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Terraform Version
1.3.4
AzureRM Provider Version
3.35.0
Affected Resource(s)/Data Source(s)
azurerm_storage_account_blob_container_sas
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The SAS token should be similar in format to the token provided from the Azure Portal. This is the obvious intuitive expectation of the mofule.
Actual Behaviour
The token is prefixed with a
?
and has been urlencoded.This feature is not documented and is not intuitive.
What's worse in some cases it is necessary to undo these magical changes in order to use the token. It is as easy as below but, at least in my case, it took several hours to suss out what was going on.
trimprefix(replace(data.azurerm_storage_account_blob_container_sas.default.sas, "%", "%%"), "?")
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: