Skip to content

Conversation

@FilPag
Copy link

@FilPag FilPag commented May 12, 2025

Related command
az apim policy

Description

  • Implementation proposal for feature request described in az apim | provide support for policies #31140
  • Fix: Parsing of additional tags in RG pre-parser to properly support multiple additional arguments.
  • Fix: issues with apim module scenario tests

Testing Guide
azdev test apim


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

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

azure-client-tools-bot-prd bot commented May 12, 2025

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

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

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

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

azure-client-tools-bot-prd bot commented May 12, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️apim
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd apim policy sub group apim policy added

@yonzhan
Copy link
Collaborator

yonzhan commented May 12, 2025

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

@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>

@FilPag FilPag changed the title [API Management] az apim policy: **Add** support for managing APIM policies [API Management] az apim policy: Add support for managing APIM policies May 12, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 12, 2025
@microsoft-github-policy-service
Copy link
Contributor

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

@FilPag
Copy link
Author

FilPag commented May 12, 2025

@microsoft-github-policy-service agree

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 31457 in repo Azure/azure-cli

@yonzhan
Copy link
Collaborator

yonzhan commented May 19, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms changed the title [API Management] az apim policy: Add support for managing APIM policies [APIM] az apim policy: Add support for managing APIM policies May 26, 2025
@zhoxing-ms
Copy link
Contributor

@FilPag please note that Azure CLI will have a code freeze on 05/27/2025 07:00 UTC for the upcoming release. Please address these comments ASAP, otherwise it has to be postponed to next sprint (07-01).

@zhoxing-ms zhoxing-ms added this to the October 2025 (2025-10-14) milestone Aug 26, 2025
Copilot AI review requested due to automatic review settings August 26, 2025 13:51
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 adds comprehensive support for managing Azure API Management (APIM) policies through a new az apim policy command group. The implementation includes commands for setting, showing, deleting, listing, and getting etags for policies at different scopes (global, API, and operation levels).

Key changes include:

  • New policy management commands with support for multiple scopes
  • Test infrastructure fixes including resource group preparer tag handling
  • Updated test data paths and removed unused test dependencies

Reviewed Changes

Copilot reviewed 8 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/azure-cli/azure/cli/command_modules/apim/custom.py Implements core policy operations with scope-aware context handling
src/azure-cli/azure/cli/command_modules/apim/commands.py Registers the new policy command group with appropriate client factory
src/azure-cli/azure/cli/command_modules/apim/_params.py Defines command parameters for policy operations including format and scope options
src/azure-cli/azure/cli/command_modules/apim/_help.py Provides comprehensive help documentation and usage examples for policy commands
src/azure-cli/azure/cli/command_modules/apim/_client_factory.py Adds client factory for policy operations
src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py Adds comprehensive policy operation tests and fixes existing test issues
src/azure-cli/azure/cli/command_modules/apim/tests/latest/data/api_policy.xml Test policy file for validation scenarios
src/azure-cli-testsdk/azure/cli/testsdk/preparers.py Fixes tag handling bug in resource group preparer

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@FilPag FilPag force-pushed the feature/apim-policy-management branch from 7eb7fff to 4683fe2 Compare August 26, 2025 13:53
@FilPag FilPag requested a review from zhoxing-ms August 26, 2025 14:46
@FilPag
Copy link
Author

FilPag commented Aug 26, 2025

Thank you for the reviews! Since my time has become more limited in recent weeks, I won't be able to generate new recordings for the tests in case anything has broken over the last few months. If anyone could help with this (if needed), it would be greatly appreciated.

Best regards,
Filip

@yanzhudd
Copy link
Contributor

Please note that the Azure CLI release process will begin on 09/30/2025 at 07:00 UTC. If this PR is intended for the upcoming release, kindly resolve the comments as soon as possible, otherwise it will need to be postponed to the next sprint.

@zhoxing-ms
Copy link
Contributor

@FilPag Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Management az apim Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants