Skip to content

Support for azurerm_mssql_managed_instance with AAD admin + azuread_authentication_only #17601

Description

@YohanValette-DXC

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

We need to have the ability to setup the AAD administrator in a block in the azurerm_mssql_managed_instance it-self.

The mssql_managed_instance_active_directory_administrator resource does not fit our needs because of the built-in Azure policy "Azure SQL Database should have Azure Active Directory Only Authentication enabled"

The problem is that when the Azure Policy has the Deny action it prevents creating a azurerm_mssql_managed_instance that do not have administrators.azureADOnlyAuthentication set.

As this parameter is set outside of the azurerm_mssql_managed_instance (that is with the mssql_managed_instance_active_directory_administrator), the MSSQL MI would not comply with the policy at first, thus it cannot be created...

New or Affected Resource(s)/Data Source(s)

azurerm_mssql_managed_instance

Potential Terraform Configuration

Having the block such as in the `azurerm_mssql_managed_instance_active_directory_administrator` resource.

An `azuread_administrator` block:

- login_username - (Required) The login username of the Azure AD Administrator of this SQL Server.
- object_id - (Required) The object id of the Azure AD Administrator of this SQL Server.
- tenant_id - (Optional) The tenant id of the Azure AD Administrator of this SQL Server.
- azuread_authentication_only - (Optional) Specifies whether only AD Users and administrators (like azuread_administrator.0.login_username) can be used to login, or also local database users (like administrator_login). When true, the administrator_login and administrator_login_password properties can be omitted.

References

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions