部署时出错:尝试以访问权限禁止的方式访问套接字

Getting error when deployed: An attempt was made to access a socket in a way forbidden by its access permissions

我在 Go 中创建了一个 Azure Functions。该功能在本地机器上正常工作。但是,当我将它部署到 Azure 时,出现以下异常:

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

内部异常方法为:System.Net.Http.ConnectHelper+<ConnectAsync>d__1.MoveNext

错误日志在这里:https://github.com/mpurusottamc/azurefunc-go/blob/master/errorlog.json

local.settings.json 文件有以下代码:

{
    "IsEncrypted": false,
    "Values": {
        "FUNCTIONS_WORKER_RUNTIME": "node",
        "AzureWebJobsStorage": "<proper storage link>"
    }
}

host.json 文件将 golang 可执行文件引用为 worker。

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true
            }
        }
    },
    "httpWorker": {
        "description": {
            "defaultExecutablePath": "hello.exe"
        }
    },
    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[1.*, 2.0.0)"
    }
}

我的代码托管在 github 此处:https://github.com/mpurusottamc/azurefunc-go

deploy.sh 文件包含部署脚本。

已关注这篇参考文章:https://itnext.io/write-azure-functions-in-any-language-with-the-http-worker-34d01f522bfd

我是不是漏掉了什么?

我在我的机器上更新了 golang 版本到 1.14。并且还在部署脚本中应用了 --force 并为我解决了这个问题。

go.mod更新如下:

module hello

go 1.14

部署脚本更新为包含 --force 参数

func azure functionapp publish hellogoapp --force