Skip to content
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_windows_web_app sticky_settings app_setting_names doesnt allow valid characters #16612

Closed
1 task done
JiriKovar opened this issue Apr 30, 2022 · 5 comments · Fixed by #17209
Closed
1 task done

Comments

@JiriKovar
Copy link

JiriKovar commented Apr 30, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.9

AzureRM Provider Version

3.4.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app and possibly everything with sticky_settings property mentioned here: #16546

Terraform Configuration Files

resource "azurerm_windows_web_app" "app_service" {
  name                = var.service_name
  location            = var.resource_group.location
  resource_group_name = var.resource_group.name
  service_plan_id     = var.app_service_plan_id

  site_config {
    always_on         = local.site_config.always_on
    ...
  }

  app_settings = {
    "ConfigManager:Location" = var.config_manager.location
    ...
  }

  sticky_settings {
    app_setting_names = ["ConfigManager:Location"] //the colon is not allowed by the azurerm provider even though we have had this setting in Azure for years
    ...
  }
}

Debug Output/Panic Output

Error: "sticky_settings.0.app_setting_names.0" may only contain alphanumeric characters, periods and underscores

Expected Behaviour

The azurerm provider allows all characters allowed in the Azure App Settings. I.e. it allows to implement the suggested hierarchical namespaces via colons, or slashes as well as use other common practices described here: https://docs.microsoft.com/en-us/azure/azure-app-configuration/concept-key-value

Actual Behaviour

The azurerm provider does not allow us to use the common key naming practices, which prevents us from upgrading from azurerm_app_service resource to the azurerm_windows_web_app

Steps to Reproduce

Try to add any setting that is allowed in the Azure App Service -> Configuration -> Application Settings that contains characters other than the characters allowed by the current provider. Other than my example with colon, you can try adding a Key Vault Reference, which has a syntax: @Microsoft.KeyVault({referenceString}). More on that: https://docs.microsoft.com/en-us/azure/app-service/app-service-key-vault-references

Important Factoids

No response

References

No response

@JiriKovar JiriKovar added the bug label Apr 30, 2022
@github-actions github-actions bot removed the bug label Apr 30, 2022
@enorlando
Copy link

enorlando commented May 1, 2022

We are also encountering this issue when using resource azurerm_windows_function_app

Error: "sticky_settings.0.app_setting_names.1" may only contain alphanumeric characters, periods and underscores

with azurerm_windows_function_app.xxx,
on xxx.tf line 256, in resource "azurerm_windows_function_app" "xxx":
 256:       "APPINSIGHTS_INSTRUMENTATIONKEY", "APPLICATIONINSIGHTS_CONNECTION_STRING ",

@nu12
Copy link

nu12 commented May 5, 2022

After importing an existing azurerm_windows_web_app, the "APPLICATIONINSIGHTS_CONNECTION_STRING " came with an extra space at the end (just like in @enorlando example above), which is not valid.

However, the error message was always pointing to the last value of the list so I was looking at the wrong place trying to debug this. Once the extra space was removed it started working again.

@enorlando
Copy link

@nu12 Thank you for your input. Once I removed the extra space from the app setting name, it all worked and I as able to apply the change.

jennings added a commit to jennings/terraform-provider-azurerm that referenced this issue Jun 10, 2022
This validation is too strict. The Azure Portal allows the following
name for both app settings and connection strings:

    A test: !@#$%^&*()_+-=' ";/?

I can't find a reference for what the valid character set would be,
and the names in the app_settings attribute aren't validated at all,
so we may as well remove this validation.

Fixes hashicorp#16612
@github-actions github-actions bot added this to the v3.12.0 milestone Jun 24, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

This functionality has been released in v3.12.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants