Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_mssql_managed_instance_failover_group : Fix "The given primary field in create or update instance failover group request body is empty or invalid" error #16705

Merged
merged 2 commits into from
May 12, 2022

Conversation

sinbai
Copy link
Contributor

@sinbai sinbai commented May 9, 2022

The customer is encountering "The given primary field in create or update instance failover group request body is empty or invalid" error when creating azurerm_mssql_managed_instance_failover_group resource. After investigation, it was found that the parameter PrimaryManagedInstanceID was set to the ID of failover group instead of the primary managed instance ID. So, I submitted this PR to fix the error.

It's worth mentioning that when the env variable ARM_TEST_LOCATION is set to eastus and the ARM_TEST_LOCATION_ALT is set to westus3, the test case TestAccMsSqlManagedInstanceFailoverGroup_update fails with error "The async operation failed" while creating azurerm_mssql_managed_instance resource on my local(There is this error both before and after this fix. And it seems that team city has the same error). After replacing the westcentralus and westus2 with the eastus and westus3 for AzureCloud, Storage, EventHub, Sql route in const managedInstanceStaticRoutes , this error went away. Since our test subscription does not support creating azurerm_mssql_managed_instance resource under westcentralus and westus2 region, I could not test on these regions.

Given that the resource azurerm_mssql_managed_instance_failover_group was contributed in PR #15203 by manicminer. @manicminer, do you have any suggesstions on how to resolve the test case failure? May I ask you help to review this PR to fix the invalid request body error to unblock the customer first?

Additionally, this PR also fixes the "cannot import non-existent remote object" error by setting location to id.LocationName instead of state.Location. This error is caused by the empty value of state.Location.

Related issue: #16566.

@github-actions github-actions bot added service/mssql Microsoft SQL Server size/XS labels May 9, 2022
Copy link
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.

Thanks @sinbai - LGTM 🧊

@github-actions
Copy link

This functionality has been released in v3.6.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/mssql Microsoft SQL Server size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants