Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Keyvault secret auto rotation and notification before expiry #106

Open
vivuu1989 opened this issue Nov 27, 2023 · 1 comment
Open

Comments

@vivuu1989
Copy link

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." 
}
@vivuu1989
Copy link
Author

Any guidance to above issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant