Skip to content

New Resource: azurerm_storage_mover_smb_mount_endpoint#31589

Open
hqhqhqhqhqhqhqhqhqhqhq wants to merge 9 commits intohashicorp:mainfrom
hqhqhqhqhqhqhqhqhqhqhq:feature/storage-mover-smb-mount-endpoint
Open

New Resource: azurerm_storage_mover_smb_mount_endpoint#31589
hqhqhqhqhqhqhqhqhqhqhq wants to merge 9 commits intohashicorp:mainfrom
hqhqhqhqhqhqhqhqhqhqhq:feature/storage-mover-smb-mount-endpoint

Conversation

@hqhqhqhqhqhqhqhqhqhqhq
Copy link
Copy Markdown
Collaborator

@hqhqhqhqhqhqhqhqhqhqhq hqhqhqhqhqhqhqhqhqhqhq commented Jan 27, 2026

This PR adds a new resource azurerm_storage_mover_smb_mount_endpoint for managing Storage Mover SMB Mount Endpoints, enabling data migration from on-premises SMB file shares to Azure.

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 introduces the azurerm_storage_mover_smb_mount_endpoint resource, which allows users to create SMB Mount endpoints for migrating data from on-premises SMB file shares to Azure using Azure Storage Mover.

Properties:

  • name - (Required) The name of the endpoint
  • storage_mover_id - (Required) The ID of the Storage Mover
  • host - (Required) The hostname or IP address of the SMB server
  • share_name - (Required) The name of the SMB share
  • username_uri - (Optional) The Azure Key Vault secret URI for the username
  • password_uri - (Optional, Sensitive) The Azure Key Vault secret URI for the password
  • description - (Optional) A description for the endpoint

This resource uses API version 2025-07-01.

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.

New Resource

  • I have added an explanation of what my resource does and why it should be included in the provider.
  • I have written acceptance tests & documentation for my resource.
  • I have successfully run acceptance tests with my changes locally.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass.

Acceptance tests pass for the new resource.

Change Log

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)

N/A

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

AI was used to assist with code generation, documentation, and test implementation.

Rollback Plan

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

Changes to Security Controls

No changes to security controls in this pull request.

@hqhqhqhqhqhqhqhqhqhqhq hqhqhqhqhqhqhqhqhqhqhq changed the title Feature/storage mover smb mount endpoint New Resource: azurerm_storage_mover_smb_mount_endpoint Jan 28, 2026
@hqhqhqhqhqhqhqhqhqhqhq hqhqhqhqhqhqhqhqhqhqhq force-pushed the feature/storage-mover-smb-mount-endpoint branch from b98ee4e to 2475163 Compare February 2, 2026 02:45
@hqhqhqhqhqhqhqhqhqhqhq hqhqhqhqhqhqhqhqhqhqhq marked this pull request as ready for review February 3, 2026 02:31
@hqhqhqhqhqhqhqhqhqhqhq hqhqhqhqhqhqhqhqhqhqhq force-pushed the feature/storage-mover-smb-mount-endpoint branch 2 times, most recently from 7504963 to b117070 Compare February 12, 2026 23:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for managing Azure Storage Mover SMB Mount Endpoints in the provider, including documentation and acceptance coverage.

Changes:

  • Introduces the azurerm_storage_mover_smb_mount_endpoint resource implementation (CRUD) wired to Microsoft.StorageMover/endpoints.
  • Adds acceptance tests for basic, complete (with Key Vault credentials), update, and import flows.
  • Publishes new resource documentation and registers the resource in the Storage Mover service.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
website/docs/r/storage_mover_smb_mount_endpoint.html.markdown New docs page for the SMB mount endpoint resource, including examples and argument/timeout/import sections.
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go New resource implementation for SMB mount endpoints (create/read/update/delete) using the Storage Mover endpoints client.
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource_test.go New acceptance tests covering create/import/update flows, including Key Vault-backed credentials.
internal/services/storagemover/registration.go Registers the new SMB mount endpoint resource with the Storage Mover service.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Collaborator

@gerrytan gerrytan left a comment

Choose a reason for hiding this comment

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

Thx @hqhqhqhqhqhqhqhqhqhqhq , I left some comments regarding the schema design and validation.

Also can you please address the Copilot generated review comments.


type StorageMoverSmbMountEndpointResource struct{}

var _ sdk.ResourceWithUpdate = StorageMoverSmbMountEndpointResource{}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to also implement sdk.ResourceWithIdentity, please check guide-new-resource.md

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added 👍

Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringIsNotEmpty,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you please check if stronger validation than StringIsNotEmpty be used? Please check what kind of validation used in portal.

Same concern with other fields with "StringIsNotEmpty" validation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

host: Must be (1) IPv4 address or (2) hostname/FQDN → added validation for this

share_name: Portal: “Must be 1-80 characters and cannot contain: /[]:<> + = ;, *? or control characters” → Updated

description: Portal: “1024 characters max” → added validation for this

ValidateFunc: validation.StringIsNotEmpty,
},

"username_uri": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be called username_key_vault_secret_id assuming it works if I supply a azurerm_key_vault_secret.mysecret.id here. Same apply to password_uri.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Both attributes are renamed to username_key_vault_secret_id and password_key_vault_secret_id

- examples/storage-mover: full example with SMB mount endpoint,
  validation-test-invalid.tf.example, README

Made-with: Cursor
…d, rename credentials to key vault secret IDs

- Implement ResourceWithIdentity: call SetResourceIdentityData after SetID in Create and in Read to fix 'Missing Resource Identity After Create'
- Align Create with guide: return metadata.Encode after SetResourceIdentityData
- Rename username_uri/password_uri to username_key_vault_secret_id/password_key_vault_secret_id in schema, docs and tests (PR feedback)

Made-with: Cursor
Add stricter validation and credential handling for StorageMover SMB mount endpoints. Host now must be a valid IPv4 address or hostname/FQDN; share_name is limited to 1-80 characters and forbids control characters and a set of punctuation; description is limited to 1024 characters. Update Update() logic to require both username_key_vault_secret_id and password_key_vault_secret_id to be set together (or both empty) and to set/clear credentials accordingly. Adjust tests formatting and update R docs to describe the new validation rules.
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.

6 participants