Skip to content

azurerm_mssql_database - fix min_capacity and auto_pause_delay_in_minutes validations for sku migration#31690

Merged
sreallymatt merged 6 commits intomainfrom
tg/mssql-sku-fix
Feb 6, 2026
Merged

azurerm_mssql_database - fix min_capacity and auto_pause_delay_in_minutes validations for sku migration#31690
sreallymatt merged 6 commits intomainfrom
tg/mssql-sku-fix

Conversation

@toddgiguere
Copy link
Contributor

@toddgiguere toddgiguere commented Feb 5, 2026

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

Fixes an issue when migrating an existing MSSQL DB from Serverless to a non-servless (e.g. ElasticPool) SKU. When performing this migration in a Terraform configuration, the following validation errors can be reported at plan time even when they are removed from the updated non-serverless configuration block:

  • min_capacity should only be specified when using a serverless database
  • auto_pause_delay_in_minutes should only be specified when using a serverless database

This fix will make sure that the current configuration block values for these parameters are used when validating this restriction.

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)

Change Log

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

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 #31638

AI Assistance Disclosure

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

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.

@toddgiguere toddgiguere requested review from a team, WodansSon and magodo as code owners February 5, 2026 20:50
@github-actions github-actions bot added bug service/mssql Microsoft SQL Server size/M labels Feb 5, 2026
@toddgiguere
Copy link
Contributor Author

TeamCity test suite: https://hashicorp.teamcity.com/buildConfiguration/TF_AzureRM_AZURERM_SERVICE_PUBLIC_MSSQL/605678

New test introduced has passed.

Copy link
Collaborator

@sreallymatt sreallymatt left a comment

Choose a reason for hiding this comment

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

Thanks @toddgiguere - LGTM ✅

@sreallymatt sreallymatt merged commit 438fb94 into main Feb 6, 2026
50 checks passed
@sreallymatt sreallymatt deleted the tg/mssql-sku-fix branch February 6, 2026 15:27
@github-actions github-actions bot added this to the v4.59.0 milestone Feb 6, 2026
anurag-hashicorp pushed a commit to anurag-hashicorp/terraform-provider-azurerm that referenced this pull request Feb 19, 2026
…inutes validations for sku migration (hashicorp#31690)

[FIX] * `azurerm_mssql_database` - fix validation for `min_capacity` and `auto_pause_delay_in_minutes`
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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 Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug service/mssql Microsoft SQL Server size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azurerm_mssql_database: upgrade to v4.57.0 blocks serverless -> ElasticPool migration with "min_capacity should only be specified" (worked in v4.7.0)

2 participants