Share via


az apic environment

Note

This reference is part of the apic-extension extension for the Azure CLI (version 2.57.0 or higher). The extension will automatically install the first time you run an az apic environment command. Learn more about extensions.

Commands to manage environments in API Center.

Commands

Name Description Type Status
az apic environment create

Create a new environment or update an existing environment.

Extension GA
az apic environment delete

Delete the environment.

Extension GA
az apic environment list

List a collection of environments.

Extension GA
az apic environment show

Get details of the environment.

Extension GA
az apic environment update

Update existing environment.

Extension GA

az apic environment create

Create a new environment or update an existing environment.

az apic environment create --environment-id
                           --resource-group
                           --service
                           --title
                           --type {development, production, staging, testing}
                           [--custom-properties]
                           [--description]
                           [--onboarding]
                           [--server]

Examples

Create environment

az apic environment create -g api-center-test -s contosoeuap --environment-id public --title "Public cloud" --type "development"

Required Parameters

--environment-id

The id of the environment.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service --service-name -s

The name of the API Center service.

--title

Environment title.

--type

Environment type.

accepted values: development, production, staging, testing

Optional Parameters

--custom-properties

The custom metadata defined for API catalog entities. Support json-file and yaml-file.

--description

Environment description.

--onboarding

Provide onboarding documentation related to your environment, e.g. {developerPortalUri:['https://developer.contoso.com'],instructions:'instructions markdown'} Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--server

Server information of the environment. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az apic environment delete

Delete the environment.

az apic environment delete [--environment-id]
                           [--ids]
                           [--resource-group]
                           [--service]
                           [--subscription]
                           [--yes]

Examples

Delete environment

az apic environment delete -g api-center-test -s contosoeuap --environment-id public

Optional Parameters

--environment-id

The id of the environment.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service --service-name -s

The name of the API Center service.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az apic environment list

List a collection of environments.

az apic environment list --resource-group
                         --service
                         [--filter]
                         [--max-items]
                         [--next-token]

Examples

List environments

az apic environment list -g api-center-test -s contosoeuap

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service --service-name -s

The name of the API Center service.

Optional Parameters

--filter

OData filter parameter.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az apic environment show

Get details of the environment.

az apic environment show [--environment-id]
                         [--ids]
                         [--resource-group]
                         [--service]
                         [--subscription]

Examples

Show environment details

az apic environment show -g api-center-test -s contosoeuap --environment-id public

Optional Parameters

--environment-id

The id of the environment.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--service --service-name -s

The name of the API Center service.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az apic environment update

Update existing environment.

az apic environment update [--add]
                           [--custom-properties]
                           [--description]
                           [--environment-id]
                           [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                           [--ids]
                           [--onboarding]
                           [--remove]
                           [--resource-group]
                           [--server]
                           [--service]
                           [--set]
                           [--subscription]
                           [--title]
                           [--type {development, production, staging, testing}]

Examples

Update environment

az apic environment update -g api-center-test -s contosoeuap --environment-id public --title "Public cloud"

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--custom-properties

The custom metadata defined for API catalog entities. Support json-file and yaml-file.

--description

Description.

--environment-id

The id of the environment.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--onboarding

{developerPortalUri:['https://developer.contoso.com'],instructions:'instructions markdown'} Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server

Server information of the environment. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--service --service-name -s

The name of the API Center service.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--title

Environment title.

--type

Environment type.

accepted values: development, production, staging, testing
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.