Skip to content

az cognitiveservices account show returns networkInjections as null on an injected Foundry account #33808

Description

@arush-saxena

Describe the bug

az cognitiveservices account show returns networkInjections: null for a Foundry (AIServices) account that does have network injection configured. The property is present and correct when the same resource is read via az rest at API version 2025-04-01-preview.

This is a false negative on a property that cannot be changed after account creation. Tooling that checks whether an existing account is network-injected — before deciding whether to deploy into it — will conclude "not injected" and may proceed against the wrong account. The remediation for a genuine mismatch is provisioning a new account and migrating, so a silent wrong answer here is expensive.

To Reproduce

Given a Foundry account created with:

properties: {
  networkInjections: [
    {
      scenario: 'agent'
      subnetArmId: '<subnet delegated to Microsoft.App/environments>'
      useMicrosoftManagedNetwork: false
    }
  ]
}

CLI:

az cognitiveservices account show -n <name> -g <rg> \
  --query "properties.networkInjections"

Output:

null

Raw REST, same resource:

az rest --method get --uri \
  "https://management.azure.com/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<name>?api-version=2025-04-01-preview" \
  --query "properties.networkInjections"

Output:

{
  "scenario": "agent",
  "subnetArmId": ".../virtualNetworks/<vnet>/subnets/agent-subnet",
  "useMicrosoftManagedNetwork": false
}

Expected behavior

az cognitiveservices account show returns networkInjections when the account has it, or documents that the command reads an API version which omits the property.

Likely cause

The cognitiveservices command module appears to pin an API version predating networkInjections, so the field is dropped during deserialisation rather than surfaced as unknown.

Environment

  • azure-cli 2.77.0
  • Resource: Microsoft.CognitiveServices/accounts, kind: AIServices
  • Region: eastus2
  • Confirmed working via REST at 2025-04-01-preview

Impact / workaround

Workaround is to bypass the CLI convenience command and use az rest with an explicit API version. That works, but it is easy to get wrong: the natural command returns a confident, incorrect answer rather than an error, so nothing signals that the result is unreliable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions