'Deploy at Heroku Azure Devops With Container (Docker Image)

I have an application that I want to deploy automated on heroku through azure devops, I already had the pipeline and release created and it was already working, the steps were login to heroku container pull and push the image from my docker hub, to login to heroku I used the api key that I get on heroku, and I used it as a variable in the release as HEROKU_API_KEY, but it stopped working, how can I solve this?



Solution 1:[1]

I used it as a variable in the release as HEROKU_API_KEY, but it stopped working, how can I solve this?

Make sure to use the following way of HEROKU_API_KEY as an authentication mechanism :

func auth() (user, password string) {
    key := os.Getenv("HEROKU_API_KEY")
    if key != "" {
        return "", key
    }
    netrc := getNetrc()
    machine := netrc.FindMachine("api.heroku.com")
    if machine == nil {

You can refer to Heroku CLI Authentication, Auth doesn't work with HEROKU_API_KEY env variable without netrc and heroku CLI auth by token

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1