2

Following Microsoft Quick Start for Function App with Go (https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-other?tabs=go%2Cwindows)

I was able to successfully run the code locally on my Windows computer. I continued to follow the steps to deploy the Function App to Azure portal and when try to run the Function App at the /api/HttpExample endpoint. It would fail to execute even though it runs fine locally.

Programming language used : Go 1.17.7

Links to source: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-other?tabs=go%2Cwindows

Bindings used

3
  • Please make your question self-contained. See stackoverflow.com/help/how-to-ask Commented Mar 22, 2022 at 12:44
  • @BB7788 - What is the error you are getting ? Commented Mar 28, 2022 at 10:38
  • @HarshithaVeeramalla-MT - Webpage fails to load Commented Apr 4, 2022 at 13:06

1 Answer 1

0

I had the same problem (working locally, wouldn't load when deployed), but I am running Linux locally. The error message I got was:

An attempt was made to access a socket in a way forbidden by its access permissions.

I was creating the Azure Function App through the VS Code Azure extension, and the default OS when creating a Function App is Windows:

Screenshot of VS Code creating Function App

The clue was to select the Advanced option and select OS->Linux. With the AZ CLI you need to add the option --os-type Linux, e.g.:

az functionapp create --os-type Linux --resource-group hellogorgplinux --consumption-plan-location eastus --runtime node --runtime-version 10 --functions-version 3 --name hellogoapplinux --storage-account hellogostglinux
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.