-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support for azurerm_mssql_managed_instance with AAD admin + azuread_authentication_only #17601
Comments
@YohanValette-DXC thanks for opening this issue here. Since setting |
@sinbai thank you for the quick answer 👍 Ok, so I understand that the Azure API it-self does not allow to use the "Azure SQL Database should have Azure Active Directory Only Authentication enabled" policy |
@YohanValette-DXC thanks for your reminder. Terraform could support it via Managed Instances API instead of ManagedInstanceAzureADOnlyAuthentications API. |
This is still needed. Managed Instance username/password are still required arguments in TF. This is undesirable if we want AAD Only authentication. Add an authentication mode argument to the MI configuration. If this is not set to "aad_only" then require username and password, otherwise they should be optional arguments. The way it appears right now is if the resource AAD Admin is used to create one, that only supports the "Use both SQL and Azure AD authentication" use case (since a password is still enabled) unless I am misunderstanding how that works. |
This is a blocker for me, my organization won't allow the creation of the managed instance by policy unless azure AD authentication only is set : sql.ManagedInstancesClient#CreateOrUpdate: Failure sending request: |
This is possible with Azure SQL Server. It should be made to work with Azure SQL Managed Instance as well. The following shows how it's done for Azure SQL Server. resource "azurerm_mssql_server" "server" {
name = local.sql_server_name
resource_group_name = data.azurerm_resource_group.rgrp.name
location = data.azurerm_resource_group.rgrp.location
version = "12.0"
# administrator_login Not required because of azuread_authentication_only
# administrator_login_password in the azuread_administrator block below.
azuread_administrator {
login_username = var.sql_ad_admin.name
object_id = var.sql_ad_admin.object_id
tenant_id = data.azurerm_client_config.current.tenant_id
azuread_authentication_only = true
}
} |
The scope of this should expand to all database services which support AAD auth, such as Postgres, MySQL..etc etc. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
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 themssql_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
References
No response
The text was updated successfully, but these errors were encountered: