[PostgreSQL] az postgres flexible-server restore/geo-restore: Add --tags parameter#32998
[PostgreSQL] az postgres flexible-server restore/geo-restore: Add --tags parameter#32998nachoalonsoportillo wants to merge 3 commits intoAzure:devfrom
az postgres flexible-server restore/geo-restore: Add --tags parameter#32998Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
Adds support for passing resource tags to the restored server when running az postgres flexible-server geo-restore, aligning geo-restore behavior with other server creation flows that already support tags.
Changes:
- Adds a
tagsparameter toflexible_server_georestoreand includes it in theServercreate payload. - Exposes
--tagson thepostgres flexible-server geo-restorecommand argument context.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py |
Accepts tags for geo-restore and forwards them into the SDK Server(...) parameters. |
src/azure-cli/azure/cli/command_modules/postgresql/_params.py |
Wires up --tags for the postgres flexible-server geo-restore command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parameters = postgresql_flexibleservers.models.Server( | ||
| point_in_time_utc=restore_point_in_time, | ||
| location=location, | ||
| source_server_resource_id=source_server_id, | ||
| create_mode="GeoRestore", | ||
| availability_zone=zone, | ||
| storage=storage | ||
| storage=storage, | ||
| tags=tags | ||
| ) |
There was a problem hiding this comment.
--tags support was added for geo-restore (passed into the Server create payload), but there doesn't appear to be a scenario test asserting that tags provided to geo-restore are actually applied on the restored server resource. Please add/extend the existing geo-restore test to pass --tags and validate the resulting server has those tags.
az postgres flexible-server restore/geo-restore: Add --tags parameter
|
@nachoalonsoportillo Please add tests for this new param. |
@calvinhzy, our backend still doesn't handle resource tags properly for PITR and GeoRestore scenarios. I've created a PR in our RP's repo to fix that. Once it's reviewed, merged, and deployed to production, I'll complete this PR with the corresponding tests, and have it ready for review, approval and merge. |
Related command
az postgres flexible-server restoreaz postgres flexible-server geo-restoreDescription
Add support for providing tags to be added to the restored server.
Testing Guide
az postgres fexible-server geo-restore ... --tags tag_key=tag_valueConfirm that the resulting restored server has the provided tags associated to the resource.
az postgres fexible-server restore ... --tags tag_key=tag_valueConfirm that the resulting restored server has the provided tags associated to the resource.
History Notes
[POSTGRESQL]
az postgres flexible-server restore/geo-restore: Add--tagsparameter to support providing tags to associate to restored serverThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.