Hi, I’m trying to add a (currently) unsupported property, ‘path_mappings’, to an App Service (see status [here]( ## azurerm_app_service will not configure Path mappings · Issue #3752 · hashicorp/terraform-provider-azurerm · GitHub). In light of that, I’m trying to use a provisioner as a work around
resource "azurerm_app_service" "as" {
name = "as-${local.app_name}"
resource_group_name = local.rg_name
location = local.rg_location
app_service_plan_id = azurerm_app_service_plan.asp.id
...
## https://github.com/hashicorp/terraform-provider-azurerm/issues/3752
provisioner "local-exec" {
when = create
for_each = {for index, value in local.path_mappings : index => value}
command = "az webapp config storage-account add --resource-group ${self.resource_group_name} --name ${self.name} --custom-id ${each.value.volume} --storage-type AzureFiles --share-name ${azurerm_storage_share.stfs.name} --account-name ${azurerm_storage_account.st.name} --access-key ${azurerm_storage_account.st.primary_access_key} --mount-path ${each.value.path}"
}
}
However I get the following error:
A reference to “each.value” has been used in a context in which it unavailable, such as when the configuration no longer contains the value in its “for_each”
│ expression. Remove this reference to each.value in your configuration to work around this error.
Is using a for_each in provisioner even possible or do I need to list out each item individually?