feat(mssql): add Azure Workload Identity support#7673
Conversation
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
758a6c4 to
cf6b498
Compare
|
/run-e2e mssql |
ee575e3 to
5788c60
Compare
JorTurFer
left a comment
There was a problem hiding this comment.
The envs added with infra's PR are a bit different, I update them
|
/run-e2e mssql |
b40ec90 to
0299561
Compare
|
/run-e2e mssql |
Add Azure AD Workload Identity authentication for the MSSQL scaler, enabling passwordless connections to Azure SQL Database. This mirrors the existing PostgreSQL scaler's workload identity implementation. - Use go-mssqldb's NewSecurityTokenConnector for token-based auth - Add token refresh with automatic reconnection on expiry - Add unit tests for workload identity metadata parsing - Add E2E test for Azure SQL with workload identity Signed-off-by: Martin Oehlert <[email protected]>
Add nil check before accessing token.ExpiresOn to prevent panic on first query when token hasn't been acquired yet. Fix unchecked error return in e2e test cleanup. Signed-off-by: Martin Oehlert <[email protected]>
The Azure MSSQL AAD workload identity e2e test requires TF_AZURE_MSSQL_* secrets that are not yet provisioned in CI. Change from require.NotEmpty (hard fail) to t.Skip so the test is skipped gracefully until infrastructure is ready. Signed-off-by: Martin Oehlert <[email protected]>
Co-authored-by: Jorge Turrado Ferrero <[email protected]> Signed-off-by: Jorge Turrado Ferrero <[email protected]> Signed-off-by: Martin Oehlert <[email protected]>
Signed-off-by: Martin Oehlert <[email protected]>
0299561 to
4b5ba8f
Compare
JorTurFer
left a comment
There was a problem hiding this comment.
LGTM, just small nitpick inline
Could you open another PR to docs repo documenting this?
Signed-off-by: Martin Oehlert <[email protected]>
I've added the documentation, is the version reference correct? |
Document the new `azure-workload` pod identity authentication path added by kedacore/keda#7673. The new subsection follows the postgresql scaler's pattern: prerequisites, parameters, remarks, and a complete TriggerAuthentication + ScaledObject example. Signed-off-by: Martin Oehlert <[email protected]>
|
/run-e2e mssql |
|
/run-e2e mssql*|azure* |
…1753) * docs(mssql): add Azure AD Workload Identity authentication section Document the new `azure-workload` pod identity authentication path added by kedacore/keda#7673. The new subsection follows the postgresql scaler's pattern: prerequisites, parameters, remarks, and a complete TriggerAuthentication + ScaledObject example. Signed-off-by: Martin Oehlert <[email protected]> * Update content/docs/2.20/scalers/mssql.md Signed-off-by: Jorge Turrado Ferrero <[email protected]> --------- Signed-off-by: Martin Oehlert <[email protected]> Signed-off-by: Jorge Turrado Ferrero <[email protected]> Co-authored-by: Martin Oehlert <[email protected]> Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Summary
azure-workloadpod identity providermssql.NewSecurityTokenConnectorwith Azure AD token acquisition for Workload Identity connectionsChanges
pkg/scalers/mssql_scaler.go: Add Workload Identity auth flow, token refresh logic, andnewMSSQLWorkloadIdentityConnectionpkg/scalers/mssql_scaler_test.go: Add test cases for Workload Identity metadata parsingpkg/scaling/scalers_builder.go: PassctxtoNewMSSQLScalertests/scalers/mssql/azure_mssql_aad_wi/: New e2e test for MSSQL with Azure AD Workload IdentityCHANGELOG.md: Document the new featureTest plan
go test ./pkg/scalers/...)go test -race ./pkg/scalers/...)go build ./...succeedsgo vet ./...passesgolangci-lintpasses on changed packagesmake verify-scalers-schemapasses/run-e2e(requires Azure infrastructure)Fixes: #6104
Docs: kedacore/keda-docs#1753