azurerm_data_factory - customer-managed encryption key "cannot parse an empty string" bug fix #28621
+135
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Note
Description
This PR fixes a bug where if
customer_managed_key_id
is set on an existing data factory,customer_managed_key_identity_id
is assumed to be present, but it could be an empty string when Managed Service Identity (MSI) is used. As a result user see a parsing error when the provider attempted to parse the json payload back into state.To reproduce the bug:
customer_managed_key_id
set and withSystemAssigned
identitycustomer_managed_key_id
to the URL of the key created in step 2 and perform another deployExpected: Terraform deploy completed with no errors
Actual: Terraform deploy failed with error:
Error: parsing "": parsing "": cannot parse an empty string
The reproduction step above reflects the
TestAccDataFactory_keyVaultKeyEncryptionWithExistingDataFactoryAndManagedServiceIdentity
I implemented in this PR.PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Acceptance test invoked with following command:
make acctests SERVICE='datafactory' TESTARGS='-run="TestAccDataFactory_"' TESTTIMEOUT='120m'
And all 17 tests passes. Please find the log via this link (access restricted, please DM me on Slack).
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_data_factory
- customer-managed encryption key "cannot parse an empty string" bug fix [azurerm_data_factory changes and corrupts customer_managed_key_id implicitly #27717]This is a (please select all that apply):
Related Issue(s)
Fixes #27717
Note
If this PR changes meaningfully during the course of review please update the title and description as required.