betr-io / terraform-provider-mssql

Terraform provider for Microsoft SQL Server
https://registry.terraform.io/providers/betr-io/mssql/latest
MIT License
36 stars 29 forks source link

Granting roles to user in Azure Synapse Dedicated Pool database #43

Open owlleg6 opened 2 years ago

owlleg6 commented 2 years ago

Hello!

Currently, it is not possible to grant role to user in Synapse dedicated database. Because, 'ALTER ROLE' is not working in such databases. Only

EXEC sp_addrolemember 'db_owner', 'User';

azure docs image

Is there is any chance to provide some parameter in "mssql_user" resource, so when you are using Synapse dedicated pool database, it would be possible to switch to "EXEC" in part of Role assignment?

https://github.com/betr-io/terraform-provider-mssql/blob/9a2d23c1fd3086d90783eb3d07b145229738471e/sql/user.go#L157

Code snippet: image

Error: image

Cheers, Oleh.