az repos policy

Manage branch policy.

Commands

az repos policy approver-count

Manage approver count policy.

az repos policy approver-count create

Create approver count policy.

az repos policy approver-count update

Update approver count policy.

az repos policy build

Manage build policy.

az repos policy build create

Create build policy.

az repos policy build update

Update build policy.

az repos policy case-enforcement

Manage case enforcement policy.

az repos policy case-enforcement create

Create case enforcement policy.

az repos policy case-enforcement update

Update case enforcement policy.

az repos policy comment-required

Manage comment required policy.

az repos policy comment-required create

Create comment resolution required policy.

az repos policy comment-required update

Update comment resolution required policy.

az repos policy create

Create a policy using a configuration file.

az repos policy delete

Delete a policy.

az repos policy file-size

Manage file size policy.

az repos policy file-size create

Create file size policy.

az repos policy file-size update

Update file size policy.

az repos policy list

List all policies in a project.

az repos policy merge-strategy

Manage merge strategy policy.

az repos policy merge-strategy create

Create merge strategy policy.

az repos policy merge-strategy update

Update merge strategy policy.

az repos policy required-reviewer

Manage required reviewer policy.

az repos policy required-reviewer create

Create required reviewer policy.

az repos policy required-reviewer update

Update required reviewer policy.

az repos policy show

Show policy details.

az repos policy update

Update a policy using a configuration file.

az repos policy work-item-linking

Manage work item linking policy.

az repos policy work-item-linking create

Create work item linking policy.

az repos policy work-item-linking update

Update work item linking policy.

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.

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.

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.

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.

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.