我尝试从Docker容器创建我的第一个虚拟Azure函数应用程序。
问题是,在从已发布的docker图像创建之后,我可以看到默认页面,但没有看到任何函数(应该显示默认函数)。
该函数也不起作用。当我输入函数HTTP时,会返回错误404。
默认页面

空函数列表

这是我的设置,我只使用默认配置。
# Create the default azure function app.
py -m venv .venv
.venv\scripts\activate
func init --worker-runtime python --docker
# Build with the docker.
docker build -f Dockerfile -t <function-app-name> .
# Verify, that the function is working.
docker run -p 8080:80 --name <name> <function-app-name>
http://localhost:8080/api/PythonFunctionExample
# Push image into the azure docker container.
docker login <docker-container-address>.azurecr.io
docker tag <docker-tag> <docker-container-address>.azurecr.io/<function-app-name>
docker push <docker-container-address>.azurecr.io/<function-app-name>
# I Created Azure Function App from the Azure Portal.
## Docker image was selected from the Docker container registry.
## Azure Plan "Functions Premium" was selected.知道有什么问题吗,我忘了什么?
发布于 2022-08-19 12:34:58
您应该为Docker容器函数选择应用服务计划( Premium V2 P1v2)而不是 for高级,因为Premium函数是无服务器功能。
https://stackoverflow.com/questions/71961233
复制相似问题