[OBO] Add CLI support for user-delegated authentication configuration#3128
[OBO] Add CLI support for user-delegated authentication configuration#3128Copilot wants to merge 9 commits intodev/anushakolan/obo-delegated-identityfrom
Conversation
Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
…ptions and add provider field Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
Aligned CLI implementation with PR #3151 in commit b0f98fe. Changes:
Generated config now matches the schema from PR #3151: {
"user-delegated-auth": {
"enabled": true,
"provider": "EntraId",
"database-audience": "https://database.windows.net"
}
} |
Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
|
@copilot make the target branch for this PR to be the branch in PR 3151, So that we won't have duplicate changes. After the PR 3151 is merged, we can merge this PR as well. |
I've rebased the branch onto However, I cannot change the PR base branch through git commands - that must be done in the GitHub UI. Please update the base branch of this PR from Note: The current remote branch state is outdated. To update it with the rebased commits, you'll need to force push manually or I can create a new branch with a different name if preferred. |
|
@copilot this branch should contain changes explicilty related to cli addition, the core implementation branch is https://github.com/Azure/data-api-builder/tree/dev/anushakolan/obo-delegated-identity. I changed the target branch of this PR to https://github.com/Azure/data-api-builder/tree/dev/anushakolan/obo-delegated-identity, so make sure there are no repeated or duplicate code as it will create conflicts. |
…ions - Delete separate UserDelegatedAuthOptions.cs file (already defined in DataSource.cs in base branch) - Add missing IsUserDelegatedAuthEnabled property to DataSource - Add missing UserDelegatedAuthOptions record definition to DataSource.cs - Restore DataSourceConverterFactory.cs to base version (already has user-delegated-auth support) Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
- DataSourceConverterFactory.cs already has user-delegated-auth support in base - DataApiBuilderException.cs no changes needed Co-authored-by: anushakolan <45540936+anushakolan@users.noreply.github.com>
I've removed all duplicate code. The branch now contains only CLI-specific changes (4 files):
All OBO implementation code (UserDelegatedAuthOptions, validators, token providers, etc.) comes from the base branch. However, the branch history needs to be rewritten with a force push to remove old commits. Since I cannot force push, please run: git fetch origin fresh-cli-branch
git push --force origin fresh-cli-branch:copilot/add-cli-support-obo-delegated-identityAlternatively, I can create a new PR with a different branch name that's already clean. |
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
@copilot why are they duplicate code changes from the target branch in this branch, please add only explicit changes related to cli in this branch, that are not there in the target branch. |
The files showing as "changed" are actually identical to the target branch - there are no duplicate code changes. I verified with The issue is the branch history: my branch was originally based on Current state (commit 8b5ccfe):
To fix the history, I need to force push. Since I cannot do that, could you please run locally: git fetch origin
git checkout -b temp-clean origin/obo-base
git cherry-pick 4792325 122f503 be514c8 7d74d47 8b5ccfe
git push --force origin temp-clean:copilot/add-cli-support-obo-delegated-identityThis will create clean history with only CLI commits on top of the OBO base. |
Why make this change?
Implements CLI configuration for OBO (On-Behalf-Of) delegated identity as specified in issue #2898. Enables operators to configure per-user Entra ID authentication to Azure SQL via CLI commands instead of manual config file editing.
This PR is stacked on top of PR #3151 (
dev/anushakolan/obo-delegated-identity) which contains the core OBO implementation. This PR adds only CLI-specific functionality and should be merged after PR #3151.What is this change?
CLI Commands Added
dab configure --data-source.user-delegated-auth.enabled true- Enable/disable OBO authenticationdab configure --data-source.user-delegated-auth.database-audience "https://database.windows.net"- Configure Azure SQL resource identifierImplementation Details
ConfigureOptions.cswith two new CLI option parametersConfigGenerator.TryUpdateConfiguredDataSourceOptions()to create/updateUserDelegatedAuthOptionsconfigurationConfiguration Output
{ "data-source": { "database-type": "mssql", "connection-string": "...", "user-delegated-auth": { "enabled": true, "provider": "EntraId", "database-audience": "https://database.windows.net" } } }Files Changed (4 CLI-specific files only)
src/Cli/Commands/ConfigureOptions.cs- CLI option definitionssrc/Cli/ConfigGenerator.cs- Configuration update logicsrc/Cli.Tests/ConfigureOptionsTests.cs- CLI configuration tests (10 tests)src/Cli.Tests/UserDelegatedAuthRuntimeParsingTests.cs- Runtime parsing tests (2 tests)No Duplicate Code
UserDelegatedAuthOptionstype from base branch (defined inDataSource.cs)DataSourceConverterFactory.cs(base already has user-delegated-auth deserialization)DataApiBuilderException.csor other core OBO filesHow was this tested?
Sample Request(s)
Initialize and configure OBO in one workflow:
Update audience for existing configuration:
dab configure --data-source.user-delegated-auth.database-audience "https://database.usgovcloudapi.net"Update only the enabled flag:
dab configure --data-source.user-delegated-auth.enabled falseValidation - fails for non-MSSQL:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.