-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoServiceHook
Michael Zanatta edited this page Aug 18, 2026
·
4 revisions
AzDoServiceHook [string] #ResourceName
{
Name = [String]$Name
PublisherId = [String]$PublisherId
EventType = [String]$EventType
ConsumerId = [String]$ConsumerId
ConsumerActionId = [String]$ConsumerActionId
[ ProjectName = [String]$ProjectName ]
[ ConsumerInputs = [HashTable]$ConsumerInputs ]
[ PublisherInputs = [HashTable]$PublisherInputs ]
[ ResourceVersion = [String]$ResourceVersion ]
[ Ensure = [String] {'Present', 'Absent'} ]
}-
Name: A logical name for the subscription. This is the key property and is not sent to Azure DevOps — service hook subscriptions have no native name, so the live subscription is matched by its identity tuple (
PublisherId+EventType+ConsumerId+ConsumerActionId, plus the consumerurlinput when present). -
ProjectName: Optional project to scope the subscription to. When supplied, its id is added to the publisher inputs as
projectId. -
PublisherId: The event publisher id (e.g.
tfsfor repos/boards/builds,rmfor releases). Mandatory. -
EventType: The event type (e.g.
git.push,build.complete,ms.vss-pipelines.run-state-changed-event). Mandatory. -
ConsumerId: The consumer id (e.g.
webHooks). Mandatory. -
ConsumerActionId: The consumer action id (e.g.
httpRequest). Mandatory. -
ConsumerInputs: The consumer input values (e.g.
@{ url = 'https://...' }). -
PublisherInputs: The publisher input values (e.g.
@{ repository = '...'; branch = 'main' }). -
ResourceVersion: The event resource version. Defaults to
1.0. -
Ensure: Specifies whether the subscription should exist. Valid values are
PresentandAbsent.
This resource manages service hook subscriptions via the Service Hooks REST API — for example a webhook that fires an HTTP request to an external system when code is pushed.
Configuration ExampleConfig {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoServiceHook NotifyOnPush {
Ensure = 'Present'
Name = 'notify-ci-on-push'
ProjectName = 'MyProject'
PublisherId = 'tfs'
EventType = 'git.push'
ConsumerId = 'webHooks'
ConsumerActionId = 'httpRequest'
ConsumerInputs = @{ url = 'https://ci.contoso.com/hook' }
}
}
}
Start-DscConfiguration -Path ./ExampleConfig -Wait -Verbose# Return the current configuration for AzDoServiceHook
$properties = @{
Name = 'notify-ci-on-push'
ProjectName = 'MyProject'
PublisherId = 'tfs'
EventType = 'git.push'
ConsumerId = 'webHooks'
ConsumerActionId = 'httpRequest'
ConsumerInputs = @{ url = 'https://ci.contoso.com/hook' }
}
Invoke-DscResource -Name 'AzDoServiceHook' -Method Get -Property $properties -ModuleName 'AzureDevOpsDscNative'parameters: {}
variables: {
ProjectName: MyProject
}
resources:
- name: Notify CI on push
type: AzureDevOpsDscNative/AzDoServiceHook
dependsOn:
- AzureDevOpsDscNative/AzDoProject/MyProject
properties:
Name: notify-ci-on-push
ProjectName: $ProjectName
PublisherId: tfs
EventType: git.push
ConsumerId: webHooks
ConsumerActionId: httpRequest
ConsumerInputs:
url: https://ci.contoso.com/hook
Ensure: PresentLCM Initialization:
$params = @{
AzureDevopsOrganizationName = "SampleAzDoOrgName"
ConfigurationDirectory = "C:\Datum\DSCOutput\"
ConfigurationUrl = 'https://configuration-path'
JITToken = 'SampleJITToken'
Mode = 'Set'
AuthenticationType = 'ManagedIdentity'
ReportPath = 'C:\Datum\DSCOutput\Reports'
}
Invoke-AzDoLCM @params- Assert-BoundParameter
- Assert-ElevatedUser
- Assert-IPAddress
- Assert-Module
- AzDoAPI_0_ProjectCache
- AzDoAPI_1_GroupCache
- AzDoAPI_2_UserCache
- AzDoAPI_3_GroupMemberCache
- AzDoAPI_4_GitRepositoryCache
- AzDoAPI_5_PermissionsCache
- AzDoAPI_6_ServicePrinciple
- AzDoAPI_7_IdentitySubjectDescriptors
- AzDoAPI_8_ProjectProcessTemplates
- AzDoAPI_9_DevOpsClassificationNodes
- Compare-DscParameterState
- Compare-ResourcePropertyState
- ConvertFrom-DscResourceInstance
- ConvertTo-Base64String
- ConvertTo-CimInstance
- ConvertTo-HashTable
- Find-Certificate
- Format-Path
- Get-AzDevOpsOperation
- Get-AzDevOpsServicesApiUri
- Get-AzDevOpsServicesUri
- AzDoAgentPool
- AzDoAgentPoolPermission
- AzDoAgentQueue
- AzDoAreaNodes
- AzDoAreaPermission
- AzDoArtifactFeed
- AzDoArtifactFeedPermission
- AzDoArtifactFeedSettings
- AzDoArtifactFeedView
- AzDoAuditStream
- AzDoBranchPolicy
- AzDoCheckConfiguration
- AzDoDeploymentGroup
- AzDoEnvironmentApproval
- AzDoEnvironmentPermission
- AzDoExtension
- AzDoGitPermission
- AzDoGitRepository
- AzDoGroupMember
- AzDoGroupPermission
- AzDoIterationNodes
- AzDoIterationPermission
- AzDoNotificationSubscription
- AzDoOrganizationGroup
- AzDoOrganizationSettings
- AzDoPipeline
- AzDoPipelineEnvironment
- AzDoPipelinePermission
- AzDoPipelineSettings
- AzDoProcess
- AzDoProcessPermission
- AzDoProject
- AzDoProjectGroup
- AzDoProjectPermission
- AzDoProjectServices
- AzDoRepositorySettings
- AzDoSecurityNamespacePermission
- AzDoServiceConnection
- AzDoServiceConnectionPermission
- AzDoServiceHook
- AzDoTaskGroup
- AzDoTeam
- AzDoTeamMember
- AzDoTeamSettings
- AzDoUserEntitlement
- AzDoVariableGroup
- AzDoVariableGroupPermission
- AzDoWiki
- AzDoWIPTags