Skip to content

Conversation

@nasc17
Copy link
Member

@nasc17 nasc17 commented Jan 26, 2026

Related command
az postgres flexible-server create/upgrade

Description
Was saying provisioning was blocked when could impact other operations such as upgrade

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings January 26, 2026 16:59
@nasc17 nasc17 requested a review from calvinhzy as a code owner January 26, 2026 16:59
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jan 26, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link

Hi @nasc17,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 26, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jan 26, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the error message shown when a location is restricted from performing operations on PostgreSQL flexible servers. The change makes the error message more generic to cover not just provisioning restrictions but other operations like upgrades.

Changes:

  • Updated error message from "The location is restricted for provisioning of flexible servers. Please try using another region." to "The location is restricted from performing this operation."
  • Added a TODO comment indicating the need for future corrections to capability calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 59 to 63
if restricted == "Enabled" and not is_offer_restriction_check_required:
raise InvalidArgumentValueError("The location is restricted for provisioning of flexible servers. Please try using another region.")
raise InvalidArgumentValueError("The location is restricted from performing this operation.")

if restricted != "Disabled" and not is_offer_restriction_check_required:
raise InvalidArgumentValueError("No available SKUs in this location.")
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

These two conditions have overlapping logic. When restricted == "Enabled", the first condition (line 59) will raise an error with the message "The location is restricted from performing this operation." However, if that error is not raised (e.g., due to is_offer_restriction_check_required being True), the second condition (line 62) will also be true since "Enabled" != "Disabled", causing it to raise a different error with the message "No available SKUs in this location."

This creates inconsistent behavior where the same state (restricted == "Enabled") can result in different error messages depending on the value of is_offer_restriction_check_required. Consider using elif for the second condition to prevent this overlap, or adjust the logic to handle the "Enabled" state more explicitly.

Copilot uses AI. Check for mistakes.
# Update once capability calls are corrected for each command
if restricted == "Enabled" and not is_offer_restriction_check_required:
raise InvalidArgumentValueError("The location is restricted for provisioning of flexible servers. Please try using another region.")
raise InvalidArgumentValueError("The location is restricted from performing this operation.")
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The error message "The location is restricted from performing this operation." is grammatically awkward because a location cannot perform an operation. Consider rephrasing to something more natural like "This operation is restricted in the selected location." or "The selected location does not support this operation." to better convey that it's the operation that's restricted in that location, not the location performing the operation.

Suggested change
raise InvalidArgumentValueError("The location is restricted from performing this operation.")
raise InvalidArgumentValueError("This operation is restricted in the selected location.")

Copilot uses AI. Check for mistakes.
geo_backup = [feature for feature in supported_features if feature.name == "GeoBackup"]
autonomous_tuning = [feature for feature in supported_features if feature.name == "IndexTuning"]

# Update once capability calls are corrected for each command
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

This TODO comment is vague and lacks an actionable plan. It's unclear what "capability calls are corrected for each command" means or what the expected outcome would be. Consider either:

  1. Making this comment more specific about what needs to be corrected and what the expected behavior should be
  2. Creating a tracking issue and referencing it in the comment
  3. Removing the comment if the current behavior is acceptable

Vague TODO comments tend to accumulate technical debt without providing clear guidance for future maintainers.

Suggested change
# Update once capability calls are corrected for each command

Copilot uses AI. Check for mistakes.
@nasc17
Copy link
Member Author

nasc17 commented Jan 26, 2026

@evelyn-ys @yonzhan please run checks and merge if pass

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 27, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@calvinhzy calvinhzy merged commit 97073a5 into Azure:dev Jan 27, 2026
54 of 56 checks passed
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.

4 participants