Skip to content

{Cognitive Services} Upgrade azure-mgmt-cognitiveservices to 15.0.0b1 and add managed-network commands - #33132

Merged
Ethan Yang (necusjz) merged 7 commits into
Azure:devfrom
M-Hietala:M-Hietala/managed-network-clean
Apr 14, 2026
Merged

Ethan Yang (necusjz) merged 7 commits into
Azure:devfrom
M-Hietala:M-Hietala/managed-network-clean

Conversation

@M-Hietala

Copy link
Copy Markdown
Member

Related command
az cognitiveservices account managed-network
az cognitiveservices account managed-network outbound-rule

Description
Add managed network and outbound rule CLI commands for Azure Cognitive Services (AI Foundry) accounts. These commands enable users to configure network isolation and control egress traffic from managed networks.

Testing Guide

New commands (all marked is_preview=True):

Managed Network:

az cognitiveservices account managed-network create — Create a managed network with isolation mode (allow_internet_outbound / allow_only_approved_outbound) and optional firewall SKU
az cognitiveservices account managed-network update — Update managed network settings
az cognitiveservices account managed-network show — Show managed network settings
az cognitiveservices account managed-network provision-network — Provision the managed network
Outbound Rules:

az cognitiveservices account managed-network outbound-rule list — List outbound rules
az cognitiveservices account managed-network outbound-rule show — Show a specific outbound rule
az cognitiveservices account managed-network outbound-rule remove — Delete an outbound rule
az cognitiveservices account managed-network outbound-rule set — Create/update an outbound rule (FQDN, PrivateEndpoint, or ServiceTag)
az cognitiveservices account managed-network outbound-rule bulk-set — Bulk create/update outbound rules from a YAML or JSON file
SDK dependency: Requires azure-mgmt-cognitiveservices~=15.0.0b1 (API version 2026-01-15-preview). The SDK PR is Azure/azure-sdk-for-python#45942. setup.py has been updated but CI will fail until the SDK is published to PyPI.

Testing Guide

Create a managed network with internet outbound access

az cognitiveservices account managed-network create
-g myResourceGroup -n myAccount
--managed-network allow_internet_outbound

Create with approved outbound only and standard firewall

az cognitiveservices account managed-network create
-g myResourceGroup -n myAccount
--managed-network allow_only_approved_outbound
--firewall-sku Standard

Show managed network settings

az cognitiveservices account managed-network show
-g myResourceGroup -n myAccount

Provision the managed network

az cognitiveservices account managed-network provision-network
-g myResourceGroup -n myAccount

Create an FQDN outbound rule

az cognitiveservices account managed-network outbound-rule set
-g myResourceGroup -n myAccount
--rule my-fqdn-rule --type fqdn
--destination "*.openai.azure.com"

Create a ServiceTag outbound rule

az cognitiveservices account managed-network outbound-rule set
-g myResourceGroup -n myAccount
--rule my-servicetag-rule --type servicetag
--destination '{"serviceTag":"Storage","protocol":"TCP","portRanges":"443"}'

List outbound rules

az cognitiveservices account managed-network outbound-rule list
-g myResourceGroup -n myAccount

Bulk set rules from a YAML file

az cognitiveservices account managed-network outbound-rule bulk-set
-g myResourceGroup -n myAccount
--file rules.yaml

Remove an outbound rule

az cognitiveservices account managed-network outbound-rule remove
-g myResourceGroup -n myAccount
--rule my-fqdn-rule


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

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Apr 3, 2026

Copy link
Copy Markdown
️✔️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

azure-client-tools-bot-prd Bot commented Apr 3, 2026

Copy link
Copy Markdown
⚠️AzureCLI-BreakingChangeTest
⚠️cognitiveservices
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd cognitiveservices account managed-network sub group cognitiveservices account managed-network added

@yonzhan

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds preview CLI support for configuring Cognitive Services (AI Foundry) managed networks and outbound rules, alongside upgrading the azure-mgmt-cognitiveservices SDK dependency to the 15.0.0b1 (2026-01-15-preview) API surface.

Changes:

  • Bump azure-mgmt-cognitiveservices dependency to 15.0.0b1 across setup and OS-specific requirements.
  • Add new preview command groups: az cognitiveservices account managed-network and ... outbound-rule with corresponding client factories, params, help, and custom implementations.
  • Update existing test recordings to the 2026-01-15-preview API version; add (currently skipped) scenario tests plus YAML/JSON bulk-set sample inputs.

Reviewed changes

Copilot reviewed 33 out of 39 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/azure-cli/setup.py Update SDK dependency version for Cognitive Services management plane.
src/azure-cli/requirements.py3.windows.txt Pin upgraded Cognitive Services management SDK version for Windows builds.
src/azure-cli/requirements.py3.Linux.txt Pin upgraded Cognitive Services management SDK version for Linux builds.
src/azure-cli/requirements.py3.Darwin.txt Pin upgraded Cognitive Services management SDK version for macOS builds.
src/azure-cli/azure/cli/command_modules/cognitiveservices/custom.py Implement managed-network and outbound-rule custom commands; adjust API properties deserialization; add regenerate key wrapper.
src/azure-cli/azure/cli/command_modules/cognitiveservices/commands.py Wire new preview command groups and route keys regenerate to custom implementation.
src/azure-cli/azure/cli/command_modules/cognitiveservices/_client_factory.py Add client factories for managed network settings/provisioning and outbound rule operations.
src/azure-cli/azure/cli/command_modules/cognitiveservices/_params.py Define CLI arguments for managed-network and outbound-rule commands.
src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py Add help entries and examples for the new managed-network command groups.
src/azure-cli/azure/cli/command_modules/cognitiveservices/_utils.py Remap renamed credential parameter keys for SDK 15.x when loading connection definitions.
src/azure-cli/azure/cli/command_modules/cognitiveservices/linter_exclusions.yml Add linter exclusions for managed-network parameter test coverage.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_managed_network.py Add scenario tests for managed-network and outbound-rule flows (currently class-level skipped).
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/data/managed_network/managed_network_outbound_rules.yaml Add YAML input example for outbound-rule bulk-set tests.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/data/managed_network/managed_network_outbound_rules.json Add JSON input example for outbound-rule bulk-set tests.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_user_owned_storage.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_private_endpoint.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_private_endpoint_connection.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_model.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_list_usages.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_list_models.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_identity_assign_when_create.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_deployment.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_crud.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_create_api_properties.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_account_public_network_access.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_account_list_usage.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_account_list_skus_legacy.yaml Re-record to use 2026-01-15-preview api-version.
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/recordings/test_cognitiveservices_account_capabilities.yaml Re-record to use 2026-01-15-preview api-version.

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

Comment thread src/azure-cli/azure/cli/command_modules/cognitiveservices/_params.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/cognitiveservices/custom.py
Comment thread src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py
Comment thread src/azure-cli/azure/cli/command_modules/cognitiveservices/_params.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/cognitiveservices/_client_factory.py Outdated
@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@M-Hietala

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 33132 in repo Azure/azure-cli

@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@trrwilson

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 33132 in repo Azure/azure-cli

@M-Hietala
M-Hietala force-pushed the M-Hietala/managed-network-clean branch from dc4ba48 to b52266e Compare April 10, 2026 14:25
@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@necusjz Ethan Yang (necusjz) changed the title [Cognitive Services] Upgrade azure-mgmt-cognitiveservices to 15.0.0b1 and add managed-network commands {Cognitive Services} Upgrade azure-mgmt-cognitiveservices to 15.0.0b1 and add managed-network commands Apr 13, 2026
@M-Hietala
M-Hietala force-pushed the M-Hietala/managed-network-clean branch from b52266e to de9e473 Compare April 13, 2026 13:51
@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@M-Hietala
M-Hietala force-pushed the M-Hietala/managed-network-clean branch from de9e473 to 3fcdead Compare April 14, 2026 11:44
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 pipeline(s) require an authorized user to comment /azp run to run.

@necusjz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@necusjz
Ethan Yang (necusjz) merged commit d41f726 into Azure:dev Apr 14, 2026
49 checks passed
khang-11 pushed a commit to khang-11/azure-cli that referenced this pull request Apr 30, 2026
saanikaguptamicrosoft added a commit to saanikaguptamicrosoft/azure-cli that referenced this pull request Jul 21, 2026
…mmands

Matches the precedent set by PR Azure#33132 (managed-network) and PR Azure#33338 (managed-compute-deployment): every new preview command group under az cognitiveservices adds a missing_command_test_coverage exclusion so azdev linter passes in CI without requiring scenario-recording tests in the same PR.
saanikaguptamicrosoft added a commit to saanikaguptamicrosoft/azure-cli that referenced this pull request Jul 21, 2026
…ates

Contributors do not manually edit HISTORY.rst. Verified in the last 12 months on Azure/azure-cli dev only the release bot (Azure CLI Bot <azpycli@microsoft.com>) touches this file. Reference PRs Azure#33132 and Azure#33338 did not modify it. The release bot generates each version section from PR titles / History Notes at release cut time. Rely on the PR title / body 'History Notes' section to be picked up for the 2.89.0 release.
saanikaguptamicrosoft added a commit to saanikaguptamicrosoft/azure-cli that referenced this pull request Jul 21, 2026
…5.0.0b3 to 15.0.0b4

Adopts the SDK release that includes Swarup's fix (Azure/azure-sdk-for-python#48096) for compute create polling. End-to-end validated in a local editable-install of 15.0.0b4: request accepted, polling correctly hits the LIST endpoint, real provisioning errors surface (no more misleading AuthorizationFailed on computeOperations/read).

CI will fail on dependency resolution until 15.0.0b4 is published to PyPI (same pre-publish precedent as PR Azure#33132). Once the SDK is on PyPI, this CLI PR is ready to merge without re-review.
saanikaguptamicrosoft added a commit to saanikaguptamicrosoft/azure-cli that referenced this pull request Jul 24, 2026
…itiveservices 15.0.0b4 api-version

SDK 15.0.0b4 uses api-version 2026-05-15-preview; all 25 existing scenario-test recording YAMLs were captured against the previous 2026-03-15-preview and now fail with VCR CannotOverwriteExistingCassetteException on the URL query-string matcher.

Mechanical replacement of 2026-03-15-preview -> 2026-05-15-preview across all cognitiveservices YAMLs (182 URL replacements, 25 files). The recorded response bodies are unchanged - the api-version is a request-side header/query only, so this is safe. Matches the precedent from PRs Azure#33132 and Azure#33338 which also refreshed the module's recording YAMLs when bumping the SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants