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

default_scema is not set for identities from EXTERNAL PROVIDER for Azure SQL Database Users. #63

Open
dhizzlewizzork opened this issue Aug 7, 2023 · 0 comments

Comments

@dhizzlewizzork
Copy link

I believe this could be updated here:
https://github.com/betr-io/terraform-provider-mssql/blob/master/sql/user.go#L113

When the default_schema is not set, we have found that identities (such as managed identities that are members of Azure Entra ID groups) run into issues when running trying to run database migrations that involve setting up schemas, tables, etc.

Typically an error is thrown similar to the following:

Error occurred during DB Migration: "The specified schema name \"<Object ID>@<Directory/Tenant ID>\" either does not exist or you do not have permission to use it."

This gets fixed by running:

ALTER USER [<Azure Entra ID Group Name>] WITH DEFAULT_SCHEMA=[dbo]

Which might be accounted for by specifying the default_schema in the CreateUser function.

@dhizzlewizzork dhizzlewizzork changed the title default_scema is not set for identities from EXTERNAL PROVIDER for Azure SQL Database Users. default_scema is not set for identities from EXTERNAL PROVIDER for Azure SQL Database Users. Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant