Andrew Best
04/06/2023, 1:15 AM401
error.
{"level":"debug","ts":"2023-04-06T01:21:07.715Z","caller":"server/middleware.go:45","msg":"POST /events – from 10.92.0.5:60147","json":{}}
{"level":"debug","ts":"2023-04-06T01:21:07.718Z","caller":"events/events_controller.go:134","msg":"handling AzureDevops post","json":{}}
{"level":"warn","ts":"2023-04-06T01:21:07.722Z","caller":"logging/simple_logger.go:161","msg":"ValidatePayload authentication failed","json":{},"stacktrace":"<http://github.com/runatlantis/atlantis/server/logging.(*StructuredLogger).Log|github.com/runatlantis/atlantis/server/logging.(*StructuredLogger).Log>\n\tgithub.com/runatlantis/atlantis/server/logging/simple_logger.go:161\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).respond\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:716\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).handleAzureDevopsPost\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:263\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).Post\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:135\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2109\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/mux@v1.8.0/mux.go:210\ngithub.com/urfave/negroni/v3.Wrap.func1\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/v3@v3.0.0/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2947\nnet/http.(*conn).serve\n\tnet/http/server.go:1991"}
{"level":"debug","ts":"2023-04-06T01:21:07.722Z","caller":"server/middleware.go:72","msg":"POST /events – respond HTTP 401","json":{}}
PePe Amengual
04/06/2023, 3:47 AMAndrew Best
04/06/2023, 3:47 AMPePe Amengual
04/06/2023, 3:47 AMAndrew Best
04/06/2023, 3:48 AMPePe Amengual
04/06/2023, 3:48 AMAndrew Best
04/06/2023, 3:48 AMPePe Amengual
04/06/2023, 6:00 AMAndrew Best
04/06/2023, 6:09 AM# create and run the Atlantis container
az container create \
--name $ATLANTIS_CONTAINER_GROUP_NAME \
--resource-group $ATLANTIS_RG_NAME \
--location $ATLANTIS_LOCATION \
--assign-identity \
--scope /subscriptions/$SUB_ID \
--azure-file-volume-account-name $ATLANTIS_STORAGE_NAME \
--azure-file-volume-account-key $STORAGE_KEY \
--azure-file-volume-share-name "atlantis-cert-share" \
--azure-file-volume-mount-path /mnt/atlantis-certs \
--image "<http://ghcr.io/runatlantis/atlantis:v0.22.3|ghcr.io/runatlantis/atlantis:v0.22.3>" \
--os-type Linux \
--restart-policy OnFailure \
--cpu 1 \
--memory 2 \
--ports 4141 \
--dns-name-label $ATLANTIS_CONTAINER_DNS_NAME \
--command-line "atlantis server \
--azuredevops-user=$AZUREDEVOPS_USER \
--azuredevops-webhook-user=$AZUREDEVOPS_WEBHOOK_USER \
--repo-allowlist=$REPO_ALLOWLIST \
--ssl-cert-file=/mnt/atlantis-certs/atlantis.crt \
--ssl-key-file=/mnt/atlantis-certs/atlantis.key \
--web-basic-auth \
--web-username={REDACTED}" \
--environment-variables \
ARM_USE_MSI=true \
ARM_SUBSCRIPTION_ID=$SUB_ID \
--secure-environment-variables \
ARM_ACCESS_KEY=$STORAGE_KEY \
ATLANTIS_AZUREDEVOPS_TOKEN=$AZUREDEVOPS_TOKEN \
ATLANTIS_AZUREDEVOPS_WEBHOOK_PASSWORD=$AZUREDEVOPS_WEBHOOK_SECRET \
ATLANTIS_WEB_PASSWORD=$ATLANTIS_WEB_PASSWORD
Basic authentication username
and Basic authentication password
.
I had entered these as the values I had configured for the --web-username
and ATLANTIS_WEB_PASSWORD
.
I just configured the AzDO webhooks to use the --azuredevops-webhook-user
and ATLANTIS_AZUREDEVOPS_WEBHOOK_PASSWORD
values. I commented on a PR and AzDO reports it as successful.webhook-user
and webhook-password
into the AzDO fields labelled Basic authentication username
and Basic authentication password
.PePe Amengual
04/06/2023, 3:00 PM