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

state.sqlserver: Add support for Azure AD auth (+ metadata.yaml) #2790

Merged
merged 9 commits into from Apr 19, 2023

Conversation

ItalyPaleAle
Copy link
Contributor

@ItalyPaleAle ItalyPaleAle commented Apr 18, 2023

Adds support for Azure AD authentication in the state.sqlserver component.

Fixes #2726

  1. First, the library we used is now deprecated and replaced by an official, Microsoft-maintained fork: https://github.com/microsoft/go-mssqldb - updated to use that library
  2. Second, although the library did already support Azure AD auth (by importing a separate package), it did in a way that was not compatible with the shared Azure auth library all other components use.
    • It's now possible to authenticate with Azure AD by setting useAzureAD: true in the metadata.
    • The other Azure AD-related options are required as usual (like "azureClientID", etc)
    • A connectionString is still required to include the URL of the database, the DB name, and any connection option. If it contains credentials, they are ignored
  3. This required doing some refactoring on the metadata parsing and struct
  4. Also added the metadata.yaml

Note: I confirmed tests pass locally, but I can't easily add them to the certification tests because it appears I may need to create a separate Azure SQL instance to use Azure AD. I can look into doing that in a subsequent PR

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Copy link
Contributor

@DeepanshuA DeepanshuA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks

state/sqlserver/metadata.yaml Outdated Show resolved Hide resolved
state/sqlserver/metadata.yaml Outdated Show resolved Hide resolved
state/sqlserver/metadata.yaml Outdated Show resolved Hide resolved
Co-authored-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
@ItalyPaleAle ItalyPaleAle added this to the v1.11 milestone Apr 19, 2023
@ItalyPaleAle ItalyPaleAle added this pull request to the merge queue Apr 19, 2023
Merged via the queue into dapr:master with commit 6b0dedf Apr 19, 2023
84 checks passed
ParrySMS pushed a commit to ParrySMS/components-contrib that referenced this pull request Apr 19, 2023
…r#2790)

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: ParrySMS <yh@szu.me>
@giovanidecusati
Copy link

Hi Team,

Just want to say thank you for the work you are doing and have considered implementing support for AAD for the SQL server state store. Looking forward to version 1.11! We are using Dapr on Azure Container App. I hope the Azure team doesn't take long to update to the new version.
Cheers,

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

Successfully merging this pull request may close these issues.

Issues with SQL Server state store and MSI auth
3 participants