Skip to content

azurerm_app_configuration_feature - Add support for custom_filter#30160

Merged
mbfrahry merged 11 commits intohashicorp:mainfrom
panoramix360:feature/custom-filters-ff-azure
Apr 8, 2026
Merged

azurerm_app_configuration_feature - Add support for custom_filter#30160
mbfrahry merged 11 commits intohashicorp:mainfrom
panoramix360:feature/custom-filters-ff-azure

Conversation

@panoramix360
Copy link
Copy Markdown
Contributor

@panoramix360 panoramix360 commented Jul 15, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This PR adds the possibility to create custom filters with the resource azurerm_app_configuration_feature aka Feature Flags on Azure, this was not supported before and didn't worked, now it adds the possibility to create them there.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)
image image

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_app_configuration_feature - support for the custom_filter property

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Closes #23497

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

Special thanks to @phsmith for all your help in running and testing these changes

@panoramix360
Copy link
Copy Markdown
Contributor Author

I'm working to run the tests and post the acceptance screenshots here, will provide when possible. Hopefully tomorrow I'll do that, I had some challenges on running because it was trying to create a resource_group.

I'm working into that.

@panoramix360
Copy link
Copy Markdown
Contributor Author

Tests added to the PR!

Copy link
Copy Markdown
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @panoramix360! Thanks for taking the time to open this issue. Unfortunately, it doesn't seem possible to remove a custom filter with the way it's been written and I've left a comment for how I found that out. I've also left a couple formatting comments as well

Comment thread internal/services/appconfiguration/app_configuration_feature_resource_test.go Outdated
Comment thread internal/services/appconfiguration/app_configuration_feature_resource_test.go Outdated
Comment on lines +257 to +270
{
Config: r.basicNoFilters(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basicCustomFilter(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes I like to check to make sure any new properties we add can also be removed by adding a basic test config to the end of the test. I did that here:

Suggested change
{
Config: r.basicNoFilters(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basicCustomFilter(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basicNoFilters(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basicCustomFilter(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basicNoFilters(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),

And it looks like it's not being removed as I get this error back

Terraform will perform the following actions:

          # azurerm_app_configuration_feature.test will be updated in-place
          ~ resource "azurerm_app_configuration_feature" "test" {
               ...
              - custom_filter {
                  - name       = "custom-filter" -> null
                  - parameters = {
                      - "param1" = "123"
                      - "param2" = "321"
                    } -> null
                }
            }

I don't see how your implementation of custom_filter is any different than the others filters so this might be an api issue. Can you dig a little further to see if you can remove a custom filter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added what you mention above.

Tested the terraform plan to remove the filters, and it seems that it's not removing the custom filter entirely, it's just transforming the fields to null, right?

# azurerm_app_configuration_feature.platform["TestFilters/TestLabel"] will be updated in-place
~ resource "azurerm_app_configuration_feature" "platform" {
      id                      = ""
      name                    = "TestFilters"
      tags                    = {
          "Environment" = "qa"
          "Owner"       = ""
          "Project"     = ""
          "Source"      = "terraform"
      }
      # (7 unchanged attributes hidden)

    - custom_filter {
        - name       = "Filter1" -> null
        - parameters = {
            - "param1" = "value1"
          } -> null
      }
    - custom_filter {
        - name       = "Filter2" -> null
        - parameters = {} -> null
      }
  }

I will dig a little further and try to remove it in my project, I hope it's not a implementation issue by Azure hehe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @mbfrahry

I tested a bit on my project and it seems the custom filters are being removed correctly.

The plans for the other filters seems to be the same as well.

# azurerm_app_configuration_feature.test will be destroyed
- resource "azurerm_app_configuration_feature" "test" {
    - configuration_store_id  = "<configuration_store_id>" -> null
    - description             = "Test description" -> null
    - enabled                 = true -> null
    - id                      = "<resource_id>" -> null
    - label                   = "TestLabel" -> null
    - locked                  = false -> null
    - name                    = "TestFilter" -> null
    - percentage_filter_value = 0 -> null
    - tags                    = {
        - "environment" = "test"
      } -> null
  }

I tested removing the custom_filter on my Azure project that I used to test it, and it removed the custom_filter as well, in the example that you sent.

Let me know your thoughts!

…esource_test.go

Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
@panoramix360
Copy link
Copy Markdown
Contributor Author

panoramix360 commented Jul 24, 2025

Thank you for the review @mbfrahry!

I'll dig a little bit more to see if we can implement the delete feature.

Maybe I'll need to debug it a little further, since the struct of the Custom Filter is different to the others.

Copy link
Copy Markdown
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird about that test issue I saw initially but is now good! Looks like we'll be good to once the linter is happy. Thanks for the fixes @panoramix360

@panoramix360
Copy link
Copy Markdown
Contributor Author

Thank you @mbfrahry

I fixed the lint.

I tried running the Make commands locally to check the lint errors, but it seems to be throwing a lot of other lint errors that are not related to any changes that I made.

Is there something specific to be done to run the golangci-lint?

Thanks!

@panoramix360 panoramix360 requested a review from mbfrahry August 5, 2025 21:01
@tomas0620
Copy link
Copy Markdown

Hi, any updates?
This feature would be great.

@panoramix360
Copy link
Copy Markdown
Contributor Author

hey @mbfrahry

Any new requests for this PR?

I can probably solve the merge conflicts this week.

@tomas0620
Copy link
Copy Markdown

Hi, any updates?

Copy link
Copy Markdown
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⛰️

@mbfrahry mbfrahry changed the title azurerm_app_configuration_feature: Adds new property custom_filters/client_filters azurerm_app_configuration_feature - Add support for custom_filter Apr 8, 2026
@mbfrahry mbfrahry merged commit fc75618 into hashicorp:main Apr 8, 2026
32 checks passed
@github-actions github-actions Bot added this to the v4.68.0 milestone Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for custom filters for azurerm_app_configuration_feature

4 participants