-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
We are following the answer provided in stackoverflow and trying to automate the secret expiry notification of our key vaults and enable auto rotation of secrets using azuredevops pipelines.
We are getting "No such host is known" error while we are trying to invoke the azuredevops server pipeline hosted in on premise from the azure runbook automation script.
param
(
[Parameter (Mandatory = $false)]
[object] $WebhookData
)
#If runbook was called from Webhook, WebhookData will not be null.
if ($WebhookData) {
#Run Azure DevOps REST API to trigger the pipeline
$token = "xxxxxxxxxxxxxxxxxxxxx"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
$url = "https://myado.com/devops/myorganization/myproject/_apis/build/builds?api-version=6.0"
$body = @"
{
`"definition`": {
`"id`": xxxxx
}
}
"@
$head = @{ Authorization =" Basic $token" }
Invoke-RestMethod -Uri $url -Method Post -Headers $head -Body $body -ContentType application/json
}
else
{
# Error
write-Error "No input data found."
}
Metadata
Metadata
Assignees
Labels
No labels