web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

azure deploy github action - GOLANG

(0) ShareShare
ReportReport
Posted on by 5

I'm working on a project and I need to deploy this project to Azure7

I deploy the application using github actions and azure's web services, the deply is successfully performed, but when trying to make a request through the postman using the url that is generated in azure, I get the following error:

The specified CGI application encountered an error and the server terminated the process.

my code is made using Golang programming language.

here are the snippets of my code:

golang:

func main() {
    dbload := Init()
    h := OpenDB(dbload)

    /*port := os.Getenv("HTTP_PLATFORM_PORT")
    if port == "" {
        port = "8080"
    }*/

    router := gin.Default()
    router.POST("/webhook/sendgrid", h.sendgridWeb)
    //router.GET("/ping", ping)
    port := os.Getenv("HTTP_PLATFORM_PORT")

    // default back to 8080 for local dev
    if port == "" {
        port = "8080"
    }

    router.Run("127.0.0.1:" + port)

}



build - web.config:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="D:\home\site\wwwroot\go-app.exe" startupTimeLimit="60">
        </httpPlatform>
    </system.webServer>
</configuration>


.github - workflows- go.yml


name: Build Go app and push to Azure

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v3

    - name: Set up Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.19.4



    - name: Build
      run: go build -o build/go-app.exe -v

    - name: Test
      run: go test
      
    - name: Deploy to Azure
      uses: Azure/webapps-deploy@v2
      with:
        app-name: golang-webhook
        package: build/
        publish-profile: ${{ secrets.azureWebAppPublishProfile }}


my code only has the post method.

the deploy succeeds, but when performing a post request via postman using the link that azure provided me in the web-app , I get the error 502 (bad geteway)-

The specified CGI application encountered an error and the server terminated the process.

I have the same question (0)
  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Unfortunately, you're in a wrong forum. This whole site is about Microsoft business applications and this particular forum is about an ERP system called Microsoft Dynamics AX.

    You'll need to find another forum. Try Microsoft Q&A or Stack Overflow, to name just a few.

  • Suggested answer
    DAnny3211 Profile Picture
    11,417 Super User 2026 Season 1 on at

    hi

    look this

    learn.microsoft.com/.../error-the-specified-cgi-application-encountered-an.html

    DAniele

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans