Open tasiorek27 opened 3 weeks ago
Hi @tasiorek27 , thanks for submitting this!
I can successfully import by replacing the /
to %2F
using the latest 4.0.1
version of the provider, so could it be the App Configuration Key doesn't exist on Azure ?
resource "azurerm_app_configuration_key" "test" {
configuration_store_id = azurerm_app_configuration.appconf.id
key = "app/b/c"
value = "a test"
}
Yeah, it does work with this workaround. What's interesting is that slashes are supported in labels
but not in key
name. Are you going to work on it?
Hi @tasiorek27 , the key
and label
need to be escaped otherwise in some special case we are unable to parse the ID. In particular, key
is escaped with Golang url.PathEscape
, and label
is escaped with url.QueryEscape
.
Below app config key is also valid:
resource "azurerm_app_configuration_key" "test" {
configuration_store_id = azurerm_app_configuration.appconf.id
key = "?label="
label = "?label="
value = "a test"
}
If we escape the key
and value
the ID looks like: https://appconf1test.azconfig.io/kv/%3Flabel=?label=%3Flabel%3D
.
But if we escape the key
and value
the ID looks like: https://appconf1test.azconfig.io/kv/?label=?label=?label=
, which is ambiguous.
Is there an existing issue for this?
Community Note
Terraform Version
1.8.5
AzureRM Provider Version
4.0.0
Affected Resource(s)/Data Source(s)
hashicorp/azurerm
Terraform Configuration Files
Expected Behaviour
The azurerm_app_configuration_key should be imported.
Actual Behaviour
If I will replace slashes with http encoded
%2F
then it will proceed but will fail as there is no such key in App Conf.Steps to Reproduce
No response
Important Factoids
No response
References
No response