I am using WebApp for Container in Azure, currently I build my own containers in Jenkins and push it to my own private registry.
My Own private registry is very basic and doesn't have functionality for WebHook, so I would like to add in my Jenkins workflow to trigger the container refresh.
I have followed these steps: https://learn.microsoft.com/en-us/azure/app-service/containers/app-service-linux-ci-cd and I got the URL but when I try to curl to it I got:
401 - Unauthorized: Access is denied due to invalid credentials. if I do a GET request like:
curl https://$user:[email protected]/docker/hook
and
HTTP Error 411. The request must be chunked or have a content length. if I do a POST request
curl -X POST curl https://$user:[email protected]/docker/hook
How I should do the request with Curl to trigger this?
Thanks,
Don't forget to escape the dollar sign at the beginning of the username.
So, for example:
curl https://\$user:[email protected]/docker/hook'
First of all
curl -X POST curl https://$user:[email protected]/docker/hook
The first error here is on $user
. When you start a word with $
your terminal will think that it's an environment variable. So for your terminal considerer as a string, you have to put a \
before the $
.
Now we have this
curl -X POST curl https://\$user:[email protected]/docker/hook
The second error is because there are some special characters in this url. So you have to put between quotes.
Now, we have this
curl -X POST curl "https://\$user:[email protected]/docker/hook"
Finishing we have to add the parameters -H
and -d
at the end of the command.
Now the command
curl -X POST curl "https://\$user:[email protected]/docker/hook" -d -H
should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With