gpt4 book ai didi

azure - 部署时出现错误: An attempt was made to access a socket in a way forbidden by its access permissions

转载 作者:行者123 更新时间:2023-12-01 21:12:59 25 4
gpt4 key购买 nike

我在 Go 中创建了一个 Azure 函数。该功能在本地机器上运行正常。但是,当我将其部署到 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 可执行文件引用作为工作线程。

{
"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

关于azure - 部署时出现错误: An attempt was made to access a socket in a way forbidden by its access permissions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63022631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com