Share via


az repos policy

Note

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

Manage branch policy.

Commands

Name Description Type Status
az repos policy approver-count

Manage approver count policy.

Extension GA
az repos policy approver-count create

Create approver count policy.

Extension GA
az repos policy approver-count update

Update approver count policy.

Extension GA
az repos policy build

Manage build policy.

Extension GA
az repos policy build create

Create build policy.

Extension GA
az repos policy build update

Update build policy.

Extension GA
az repos policy case-enforcement

Manage case enforcement policy.

Extension GA
az repos policy case-enforcement create

Create case enforcement policy.

Extension GA
az repos policy case-enforcement update

Update case enforcement policy.

Extension GA
az repos policy comment-required

Manage comment required policy.

Extension GA
az repos policy comment-required create

Create comment resolution required policy.

Extension GA
az repos policy comment-required update

Update comment resolution required policy.

Extension GA
az repos policy create

Create a policy using a configuration file.

Extension GA
az repos policy delete

Delete a policy.

Extension GA
az repos policy file-size

Manage file size policy.

Extension GA
az repos policy file-size create

Create file size policy.

Extension GA
az repos policy file-size update

Update file size policy.

Extension GA
az repos policy list

List all policies in a project.

Extension GA
az repos policy merge-strategy

Manage merge strategy policy.

Extension GA
az repos policy merge-strategy create

Create merge strategy policy.

Extension GA
az repos policy merge-strategy update

Update merge strategy policy.

Extension GA
az repos policy required-reviewer

Manage required reviewer policy.

Extension GA
az repos policy required-reviewer create

Create required reviewer policy.

Extension GA
az repos policy required-reviewer update

Update required reviewer policy.

Extension GA
az repos policy show

Show policy details.

Extension GA
az repos policy update

Update a policy using a configuration file.

Extension GA
az repos policy work-item-linking

Manage work item linking policy.

Extension GA
az repos policy work-item-linking create

Create work item linking policy.

Extension GA
az repos policy work-item-linking update

Update work item linking policy.

Extension GA

az repos policy create

Create a policy using a configuration file.

Recommended when creating policies using multiple scopes for a policy. See https://aka.ms/azure-devops-cli-docs-policy-file for more information.

az repos policy create --config
                       [--detect {false, true}]
                       [--org]
                       [--project]

Required Parameters

--config --policy-configuration

Local file path for configuration file. Please use \backslash when typing in directory path.

Optional Parameters

--detect

Automatically detect organization.

Accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

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 repos policy delete

Delete a policy.

az repos policy delete --id
                       [--detect {false, true}]
                       [--org]
                       [--project]
                       [--yes]

Required Parameters

--id --policy-id

ID of the policy.

Optional Parameters

--detect

Automatically detect organization.

Accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--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 repos policy list

List all policies in a project.

az repos policy list [--branch]
                     [--detect {false, true}]
                     [--org]
                     [--project]
                     [--repository-id]

Optional Parameters

--branch

Branch name to filter results by exact match of branch name. The --repository-id parameter is required to use the branch filter. For example: --branch master.

--detect

Automatically detect organization.

Accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

--repository-id

ID of the repository to filter results by exact match of the repository ID. For example --repository-ID e556f204-53c9-4153-9cd9-ef41a11e3345.

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 repos policy show

Show policy details.

az repos policy show --id
                     [--detect {false, true}]
                     [--org]
                     [--project]

Required Parameters

--id --policy-id

ID of the policy.

Optional Parameters

--detect

Automatically detect organization.

Accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

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 repos policy update

Update a policy using a configuration file.

Recommended when creating policies using multiple scopes for a policy. See https://aka.ms/azure-devops-cli-docs-policy-file for more information.

az repos policy update --config
                       --id
                       [--detect {false, true}]
                       [--org]
                       [--project]

Required Parameters

--config --policy-configuration

Local file path for configuration file. Please use \backslash when typing in directory path.

--id --policy-id

ID of the policy.

Optional Parameters

--detect

Automatically detect organization.

Accepted values: false, true
--org --organization

Azure DevOps organization URL. You can configure the default organization using az devops configure -d organization=ORG_URL. Required if not configured as default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/.

--project -p

Name or ID of the project. You can configure the default project using az devops configure -d project=NAME_OR_ID. Required if not configured as default or picked up via git config.

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.