Skip to content

azurerm_machine_learning_workspace - support service_side_encryption_enabled property#30478

Merged
catriona-m merged 5 commits intohashicorp:mainfrom
teowa:aml-service-side-encryption
Sep 23, 2025
Merged

azurerm_machine_learning_workspace - support service_side_encryption_enabled property#30478
catriona-m merged 5 commits intohashicorp:mainfrom
teowa:aml-service-side-encryption

Conversation

@teowa
Copy link
Collaborator

@teowa teowa commented Aug 26, 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

azurerm_machine_learning_workspace - support service_side_encryption_enabled property

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)

Test can pass except two are not related in the PR
image

Change Log

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

  • azurerm_machine_learning_workspace - support service_side_encryption_enabled property [GH-00000]

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)

Fixes #30177

Rollback Plan

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

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

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

Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

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

@teowa, thanks for opening this PR, I have given it a look and while it mostly LGTM, I think there are some issues that need to be addressed or clarified. I have left a few comments, have a look when you get a chance. Thanks! 🚀

Optional: true,
ForceNew: true,
Default: false,
RequiredWith: []string{"encryption"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this new field is RequiredWith the existing field encryption, wouldn't this be a breaking change? Users that already have existing instances with encryption defined would now get a an error stating the service_side_encryption_enabled is required? If so, wouldn't that also potentially lead to customer data loss since both of these fields are marked as ForceNew? Looking at the learn documentation it looks like the two are not required to be linked together:

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @WodansSon , the RequiredWith here means if service_side_encryption_enabled is set, encryption block must be specified. From Azure Portal, the Use service-side encryption option can only be enabled after Encrypt data using a customer managed key is selected.
image
image


* `serverless_compute` - (Optional) A `serverless_compute` block as defined below.

* `service_side_encryption_enabled` - (Optional) Whether to enable service-side encryption with customer-managed keys (CMK). Default to `false`. Changing this forces a new resource to be created.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this correct? Since the existing encryption field actually has the CMK implementation and this is for enabling service side encryption, which infers that the certificate which is used for the encryption will be supplied by the service? We should also add a critical note stating that When you use service-side encryption, Azure charges will continue to accrue during the soft delete retention period.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

service_side_encryption_enabled indicates that the infrastructure needed for implementing a customer-managed key (CMK) is no longer present in the customer's subscription. You can find more information at this link.

Previously, when using a customer-managed key, Azure Machine Learning creates a secondary resource group in your subscription which contains additonal resources. With this preview, this is no longer needed and all service metadata will be encrypted service-side.


note added

sku_name = "Basic"
high_business_impact = true
public_network_access_enabled = true
service_side_encryption_enabled = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need more tests for this specifically, the existing test cases only test the positive test case, where service_side_encryption_enabled is always true. We need to have tests that verify that you can have the service_side_encryption_enabled false and the encryption filed with a user defined CMK(default, classic mode). service_side_encryption_enabled true without the encryption field being defined, etc.

Copy link
Collaborator Author

@teowa teowa Sep 5, 2025

Choose a reason for hiding this comment

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

Test added for service_side_encryption_enabled false and the encryption filed with a user defined CMK.
This case is not allowed: service_side_encryption_enabled true without the encryption field being defined,

@teowa
Copy link
Collaborator Author

teowa commented Sep 19, 2025

Hi @WodansSon , thank you for reviewing this. I have updated the code; could you please take another look?
All tests are passing except for the _requiresImport tests, which will be addressed in #30653. Also, TestAccMachineLearningWorkspaceNetworkOutboundRulePrivateEndpoint_redis is unrelated to this PR.
image

@catriona-m catriona-m self-assigned this Sep 22, 2025
Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

Thanks @teowa LGTM!

@catriona-m catriona-m dismissed WodansSon’s stale review September 23, 2025 13:39

comments addressed

@catriona-m catriona-m merged commit b377570 into hashicorp:main Sep 23, 2025
34 checks passed
@github-actions github-actions bot added this to the v4.46.0 milestone Sep 23, 2025
catriona-m added a commit that referenced this pull request Sep 23, 2025
sreallymatt pushed a commit that referenced this pull request Sep 24, 2025
mbfrahry pushed a commit that referenced this pull request Sep 25, 2025
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for the enablement of Service-side encryption when deploying the azure machine learning workspaces

3 participants