-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Create Azure SQL Server and Azure AD administrators in same request #13677
Comments
#13622 is merged, I'll give it a try! |
@timwebster9 It is working for creation of new servers (PR follows soon), but updates cannot be done following the same mechanism, still possibly breaking your policy at the moment. I'm figuring out if it is possible to work around that issue as well, as it might happen that you want to change admins. |
This functionality has been released in v2.82.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! |
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. |
Community Note
Description
This is kind of halfway between a bug and a feature request, so apologies if it's not the correct issue type.
It appears that when creating a SQL Server and Azure AD administrator, they are provisioned using separate requests using the REST API (see gist here) However it is possible to create them both in a single request using the
properties.administrators
field: https://docs.microsoft.com/en-us/rest/api/sql/2021-02-01-preview/servers/create-or-updateThe reason this would be useful is for users of Azure Policy. For example, we would like all instances of SQL server to be provisioned with an Azure AD administrator, or the provisioning request should be rejected. Because this is done in separate requests, we cannot enforce this and have to allow the provisioning of the server without the Azure AD admin. At best we have to use an audit policy and then chase teams to add an Azure AD admin after the fact.
Policy is critically important in enterprise environments, and it makes things difficult in these environments if Terraform and Policy don't play together well.
There is already another resource for adding an Azure AD admin separately, and that could be kept: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/sql_active_directory_administrator
New or Affected Resource(s)
Potential Terraform Configuration
The configuration could remain unchanged:
The text was updated successfully, but these errors were encountered: