az cognitiveservices account costcontrol
Note
This reference is part of the foundry-cost-control extension for the Azure CLI (version 2.75.0 or higher). The extension will automatically install the first time you run an az cognitiveservices account costcontrol command. Learn more about extensions.
Command group 'az cognitiveservices' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage Cost Control Policies in Foundry.
A set of commands to manage Cost Control Policies in Foundry. Supported commands are create, delete, list, show and update. Use those policies to set a threshold on the cost (in USD) per time period for token use by your account or deployment. You can also set alerts to get notified when this threshold approaches.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az cognitiveservices account costcontrol create |
Create a cost control. |
Extension | Preview |
| az cognitiveservices account costcontrol delete |
Delete a cost control. |
Extension | Preview |
| az cognitiveservices account costcontrol list |
List the cost controls owned by an account. |
Extension | Preview |
| az cognitiveservices account costcontrol show |
Get a cost control. |
Extension | Preview |
| az cognitiveservices account costcontrol update |
Update a cost control. |
Extension | Preview |
az cognitiveservices account costcontrol create
Command group 'az cognitiveservices account costcontrol' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Create a cost control.
az cognitiveservices account costcontrol create --account-name
--cost-control-name --name
--resource-group
[--acquire-policy-token]
[--change-reference]
[--display-name]
[--if-match]
[--if-none-match]
[--rules]
Examples
Create a cost control with all settings
az cognitive-services account cost-control create --resource-group foundry-resource-group --account-name foundry-account --cost-control-name production-agents --if-none-match * --display-name Production agent monthly budget --rules "[{name:monthly-agent-budget,counter-key:[{type:agent}],unit:usd,amount:1000,period:month,recurring:True,match:{foundry-caller-agent-id:[customer-support-agent,sales-assistant-agent],foundry-caller-identity-oid:[11111111-2222-3333-4444-555555555555],foundry-caller-session-id:[production-session],foundry-project-id:[/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/foundry-resource-group/providers/Microsoft.CognitiveServices/accounts/foundry-account/projects/production]},thresholds:[{type:percentage,value:80,action:alert},{type:absolute,value:1000,action:audit}]},{name:daily-tenant-budget,counter-key:[{type:custom,attribute:x-tenant-id}],unit:usd,amount:100,period:day,recurring:True,thresholds:[{type:percentage,value:90,action:alert}]}]"
Required Parameters
The name of Cognitive Services account.
The name of the CostControl.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
An optional human-readable name for the cost control.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Proceeds only when the current entity tag matches this value.
Proceeds only when the current entity tag does not match this value.
The rules enforced by the cost control. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cognitiveservices account costcontrol delete
Command group 'az cognitiveservices account costcontrol' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete a cost control.
az cognitiveservices account costcontrol delete [--account-name]
[--acquire-policy-token]
[--change-reference]
[--cost-control-name --name]
[--ids]
[--if-match]
[--resource-group]
[--subscription]
[--yes]
Examples
Delete a cost control conditionally
az cognitive-services account cost-control delete --resource-group foundry-resource-group --account-name foundry-account --cost-control-name production-agents --if-match "00000000-0000-0000-0000-000000000002"
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of Cognitive Services account.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The name of the CostControl.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Proceeds only when the current entity tag matches this value.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cognitiveservices account costcontrol list
Command group 'az cognitiveservices account costcontrol' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List the cost controls owned by an account.
az cognitiveservices account costcontrol list --account-name
--resource-group
[--max-items]
[--next-token]
Examples
List cost controls with all settings
az cognitive-services account cost-control list --resource-group foundry-resource-group --account-name foundry-account
Required Parameters
The name of Cognitive Services account.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
| Property | Value |
|---|---|
| Parameter group: | Pagination Arguments |
Token to specify where to start paginating. This is the token value from a previously truncated response.
| Property | Value |
|---|---|
| Parameter group: | Pagination Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cognitiveservices account costcontrol show
Command group 'az cognitiveservices account costcontrol' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get a cost control.
az cognitiveservices account costcontrol show [--account-name]
[--cost-control-name --name]
[--ids]
[--resource-group]
[--subscription]
Examples
Get a cost control with all settings
az cognitive-services account cost-control show --resource-group foundry-resource-group --account-name foundry-account --cost-control-name production-agents
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of Cognitive Services account.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
The name of the CostControl.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az cognitiveservices account costcontrol update
Command group 'az cognitiveservices account costcontrol' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Update a cost control.
az cognitiveservices account costcontrol update [--account-name]
[--acquire-policy-token]
[--add]
[--change-reference]
[--cost-control-name --name]
[--display-name]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--if-match]
[--if-none-match]
[--remove]
[--resource-group]
[--rules]
[--set]
[--subscription]
Examples
Create a cost control with all settings
az cognitive-services account cost-control update --resource-group foundry-resource-group --account-name foundry-account --cost-control-name production-agents --if-none-match * --display-name Production agent monthly budget --rules "[{name:monthly-agent-budget,counter-key:[{type:agent}],unit:usd,amount:1000,period:month,recurring:True,match:{foundry-caller-agent-id:[customer-support-agent,sales-assistant-agent],foundry-caller-identity-oid:[11111111-2222-3333-4444-555555555555],foundry-caller-session-id:[production-session],foundry-project-id:[/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/foundry-resource-group/providers/Microsoft.CognitiveServices/accounts/foundry-account/projects/production]},thresholds:[{type:percentage,value:80,action:alert},{type:absolute,value:1000,action:audit}]},{name:daily-tenant-budget,counter-key:[{type:custom,attribute:x-tenant-id}],unit:usd,amount:100,period:day,recurring:True,thresholds:[{type:percentage,value:90,action:alert}]}]"
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of Cognitive Services account.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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>.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The name of the CostControl.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
An optional human-readable name for the cost control.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
| Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
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.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Proceeds only when the current entity tag matches this value.
Proceeds only when the current entity tag does not match this value.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
The rules enforced by the cost control. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |