Skip to content

Fix SQL Server Entra ID user matching in google_sql_user - #18794

Draft
ajupazhamayil wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ajupazhamayil:fix-sqlserver-entraid-user
Draft

Fix SQL Server Entra ID user matching in google_sql_user#18794
ajupazhamayil wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
ajupazhamayil:fix-sqlserver-entraid-user

Conversation

@ajupazhamayil

@ajupazhamayil ajupazhamayil commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Fixes an issue where creating a Cloud SQL SQL Server Entra ID user (type = "ENTRAID_USER") fails on refresh with Root object was present, but now absent.
resourceSqlUserRead was stripping @domain using strings.Split(name, "@")[0] for all non-Postgres engines.

For email-based Entra ID users (e.g. user@tenant.onmicrosoft.com), this causs name matching to fail against the API response.
This change exempts ENTRAID_USER from domain stripping so the full email names is preserved.

Tests

  • Verified manually end-to-end against a Cloud SQL SQL Server 2022 instance (creating, and deleting ENTRAID_USER).
  • Note: Acceptance tests for ENTRAID_USER require pre-provisioned Azure Active Directory certificates and tenant configuration on the instance, so end-to-end testing was performed manually.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

sql: fixed issue where creating SQL Server Entra ID users (`google_sql_user` with `type = "ENTRAID_USER"`) failed state refresh due to username domain truncation

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 26, 2026
@ajupazhamayil
ajupazhamayil force-pushed the fix-sqlserver-entraid-user branch from 16a1070 to bedca96 Compare August 26, 2026 12:01
Exempt ENTRAID_USER from strings.Split in resourceSqlUserRead so full
email UPN names are preserved and matched against Cloud SQL API responses.
Also document ENTRAID_USER for SQL Server in sql_user documentation.
@ajupazhamayil
ajupazhamayil force-pushed the fix-sqlserver-entraid-user branch from bedca96 to d413316 Compare August 26, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants