Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RylandDeGregory/175ac850392992509e0f3cc8abfa90f2 to your computer and use it in GitHub Desktop.
Save RylandDeGregory/175ac850392992509e0f3cc8abfa90f2 to your computer and use it in GitHub Desktop.
Invoke Azure App Service Web App for Containers CI/CD webhook for docker container image re-pull/version update.
# https://learn.microsoft.com/en-us/azure/app-service/deploy-ci-cd-custom-container?tabs=private&pivots=container-linux#4-enable-cicd
$WebhookURL = ''
$Username = $WebhookURL.Split('https://').Split(':')[1].Split('@')[0]
$Password = $WebhookURL.Split('https://').Split(':')[2].Split('@')[0]
$Headers = @{ 'Authorization' = "Basic $([Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$Username`:$Password")))" }
Invoke-RestMethod -Method Post -Uri "https://$($WebhookURL.Split('@')[1])" -Headers $Headers -UserAgent 'powershell/1.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment