Share via


DevOps Policy Assignments - Create Or Update

Creates or updates a DevOps Policy Assignment Resource.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/policyAssignments/{policyAssignmentId}?api-version=2024-05-15-preview

URI Parameters

Name In Required Type Description
policyAssignmentId
path True

string

The policy assignment Id.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

securityConnectorName
path True

string

The security connector name.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
properties

DevOpsPolicyAssignmentProperties

Properties of the DevOps policy assignment resource.

Responses

Name Type Description
200 OK

DevOpsPolicyAssignment

Creates or updates a DevOps Policy Assignment.

201 Created

DevOpsPolicyAssignment

Created

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

CreateOrUpdate_DevOpsPolicyAssignments

Sample request

PUT https://management.azure.com/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/policyAssignments/5ec87f43-62d8-437b-8f46-4c8d4032cf6d?api-version=2024-05-15-preview

{
  "properties": {
    "resourceId": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourcegroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/Contoso",
    "descendantBehavior": "Override",
    "policy": {
      "policyName": "myDevOpsPolicy",
      "policyId": "00000000-0000-0000-0000-000000000000",
      "policyVersion": "1.0",
      "policyType": "Pipeline"
    }
  }
}

Sample response

{
  "properties": {
    "resourceId": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourcegroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/Contoso",
    "descendantBehavior": "Override",
    "policy": {
      "policyName": "myDevOpsPolicy",
      "policyId": "00000000-0000-0000-0000-000000000000",
      "policyVersion": "1.0",
      "policyType": "Pipeline"
    },
    "provisioningState": "Succeeded"
  },
  "id": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/policyAssignments/5ec87f43-62d8-437b-8f46-4c8d4032cf6d",
  "name": "5ec87f43-62d8-437b-8f46-4c8d4032cf6d",
  "type": "Microsoft.Security/securityConnectors/devops/policyAssignments"
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/4e826cf1-5c36-4808-a7d2-fb4f5170978b?api-version=2024-05-15-preview
{
  "properties": {
    "resourceId": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourcegroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/Contoso",
    "descendantBehavior": "Override",
    "policy": {
      "policyName": "myDevOpsPolicy",
      "policyId": "00000000-0000-0000-0000-000000000000",
      "policyVersion": "1.0",
      "policyType": "Pipeline"
    },
    "provisioningState": "Accepted"
  },
  "id": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/policyAssignments/5ec87f43-62d8-437b-8f46-4c8d4032cf6d",
  "name": "5ec87f43-62d8-437b-8f46-4c8d4032cf6d",
  "type": "Microsoft.Security/securityConnectors/devops/policyAssignments"
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

DescendantBehavior

The behavior of a policy on descendant resources.

DevOpsPolicyAssignment

DevOps Policy assignment resource.

DevOpsPolicyAssignmentProperties

Properties of the DevOps policy assignment resource.

DevOpsPolicyDescriptor

Condensed information to identify a DevOps Policy resource.

DevOpsPolicyType

DevOps Policy resource types.

DevOpsProvisioningState

The provisioning state of the resource.

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure - Deletion failure.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

DescendantBehavior

The behavior of a policy on descendant resources.

Value Description
Unknown
Override
FallBack

DevOpsPolicyAssignment

DevOps Policy assignment resource.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties

DevOpsPolicyAssignmentProperties

Properties of the DevOps policy assignment resource.

systemData

systemData

Metadata pertaining to creation and last modification of the resource.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

DevOpsPolicyAssignmentProperties

Properties of the DevOps policy assignment resource.

Name Type Description
assignedAt

string (date-time)

Gets or sets time when the assignment was created in UTC.

descendantBehavior

DescendantBehavior

The behavior of a policy on descendant resources.

policy

DevOpsPolicyDescriptor

Condensed information to identify a DevOps Policy resource.

provisioningState

DevOpsProvisioningState

The provisioning state of the resource.

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure - Deletion failure.

provisioningStatusMessage

string

Gets the resource status message.

provisioningStatusUpdateTimeUtc

string (date-time)

Gets the time when resource was last checked.

resourceId

string (arm-id)

Gets or sets the Azure resource id.

DevOpsPolicyDescriptor

Condensed information to identify a DevOps Policy resource.

Name Type Description
policyId

string

Gets or sets the policy GUID.

policyName

string

Gets or sets the policy name.

policyType

DevOpsPolicyType

DevOps Policy resource types.

policyVersion

string

Gets or sets the version.

DevOpsPolicyType

DevOps Policy resource types.

Value Description
Unknown
Pipeline

DevOpsProvisioningState

The provisioning state of the resource.

Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion successful. DeletionFailure - Deletion failure.

Value Description
Succeeded
Failed
Canceled
Pending
PendingDeletion
DeletionSuccess
DeletionFailure

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.