[POSTGRESQL] az postgres flexible-server create/restore/geo-restore/replica create: Add new arguments --federated-client-id and --backup-federated-client-id to support multi-tenant application registration#33645
Open
nasc17 wants to merge 2 commits into
Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Hi @nasc17, |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
Collaborator
|
POSTGRESQL |
az postgres flexible-server create/restore/geo-restore/replica create: Add new arguments --federated-client-id and --geo-backup-federated-client-id to support multi-tenant application registrationaz postgres flexible-server create/restore/geo-restore/replica create: Add new arguments --federated-client-id and --backup-federated-client-id to support multi-tenant application registration
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the PostgreSQL flexible server BYOK (Azure Key Vault) flow to support multi-tenant application registration by introducing new CLI arguments for federated identity client IDs, and wiring them through validation and request payload construction.
Changes:
- Added
--federated-client-idand--backup-federated-client-idCLI parameters and surfaced them in help. - Extended BYOK validation to account for federated client IDs.
- Passed federated client IDs into the
DataEncryptionpayload when building server parameters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py |
Adds federated client ID validation to BYOK validator flow. |
src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_util.py |
Extends BYOK identity/encryption payload builder to include federated client IDs. |
src/azure-cli/azure/cli/command_modules/postgresql/commands/replica_commands.py |
Threads new federated client ID args through replica create validation and payload building. |
src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py |
Threads new federated client ID args through create/restore/update/geo-restore command paths. |
src/azure-cli/azure/cli/command_modules/postgresql/_params.py |
Adds the new arguments to command argument contexts. |
src/azure-cli/azure/cli/command_modules/postgresql/_help.py |
Documents an example of using --federated-client-id for cross-tenant Key Vault. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
78
to
+79
| geo_redundant_backup=None, byok_identity=None, byok_key=None, backup_byok_identity=None, backup_byok_key=None, | ||
| federated_client_id=None, geo_backup_federated_client_id=None, |
Comment on lines
+142
to
+143
| federated_client_id=federated_client_id, | ||
| geo_backup_federated_client_id=geo_backup_federated_client_id, |
Comment on lines
+186
to
+187
| federated_client_id=federated_client_id, | ||
| geo_backup_federated_client_id=geo_backup_federated_client_id) |
Comment on lines
+334
to
+336
| byok_identity=None, byok_key=None, backup_byok_identity=None, backup_byok_key=None, | ||
| federated_client_id=None, geo_backup_federated_client_id=None, | ||
| storage_type=None, yes=False): |
Comment on lines
+372
to
+374
| pg_byok_validator(byok_identity, byok_key, backup_byok_identity, backup_byok_key, geo_redundant_backup, | ||
| federated_client_id=federated_client_id, | ||
| geo_backup_federated_client_id=geo_backup_federated_client_id) |
Comment on lines
+738
to
+739
| federated_client_id=federated_client_id, | ||
| geo_backup_federated_client_id=geo_backup_federated_client_id) |
Comment on lines
+772
to
+773
| federated_client_id=federated_client_id, | ||
| geo_backup_federated_client_id=geo_backup_federated_client_id) |
Comment on lines
+402
to
+406
| raise ArgumentUsageError('To use --federated-client-id or --geo-backup-federated-client-id, ' | ||
| 'provide --identity and --key together.') | ||
| if not (instance.data_encryption and instance.data_encryption.type == 'AzureKeyVault'): | ||
| logger.warning('You cannot update data encryption properties on a server ' | ||
| 'that was not created with data encryption..') |
Comment on lines
+410
to
+412
| raise ArgumentUsageError('The primary federated client ID and backup federated client ID cannot be the same. ' | ||
| 'Provide different IDs for --federated-client-id and ' | ||
| '--geo-backup-federated-client-id.') |
Comment on lines
374
to
+377
| def build_identity_and_data_encryption(db_engine, byok_identity=None, backup_byok_identity=None, | ||
| byok_key=None, backup_byok_key=None, instance=None): | ||
| byok_key=None, backup_byok_key=None, | ||
| federated_client_id=None, backup_federated_client_id=None, | ||
| instance=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az postgres flexible-server createaz postgres flexible-server restoreaz postgres flexible-server geo-restoreaz postgres flexible-server replica createDescription
Allow support for servers with Azure Key Vault from a different Microsoft Entra tenant using multi-tenant application registration.
Testing Guide
Manual
History Notes
[POSTGRESQL]
az postgres flexible-server create/restore/geo-restore/replica create: Add new arguments--federated-client-idand--backup-federated-client-idto support multi-tenant application registration