Azure 的 sls 部署给出错误 AWS 凭证缺失

问题描述 投票:0回答:1

我按照 https://github.com/serverless/serverless-azure-functions?tab=readme-ov-file#create-a-new-azure-function-app 步骤创建了一个无服务器应用程序。

运行命令:

sls create -t azure-python -p <appName>
给出错误
Configuration file not found in directory "/Users/<path>/z-serverless"
。我创建了一个带有虚拟数据的 serverless.yml 文件,然后运行相同的命令会出现错误:

✖ AWS credentials missing or invalid. Run "serverless" to set up AWS credentials, or learn more in our docs: http://slss.io/aws-creds-setup.

我在运行任何无服务器命令时遇到此错误。

以下是

serverless.yml
文件的内容:

# "org" ensures this Service is used with the correct Serverless Framework Access Key.
org: t
# "app" enables Serverless Framework Dashboard features and sharing them with other Services.
app: z-serverless
service: azure-serverless
useDotenv: true

provider:
  name: azure
  region: westus
  runtime: python3.8 # python3.7 or python3.8 also available
  os: linux  # linux is the only operating system available for python
  subscriptionId: <subscriptionId>

plugins: # look for additional plugins in the community plugins repo: https://github.com/serverless/plugins
  - serverless-azure-functions
  - serverless-dotenv-plugin

# you can add packaging information here
package:
  patterns:
    - '!env/**'
    - '!.env/**'
    - '!local.settings.json'
    - '!.vscode/**'
    - '!__pycache__/**'
    - '!node_modules/**'
    - '!.python_packages/**'
    - '!.funcignore'
    - '!package.json'
    - '!package-lock.json'
    - '!.gitignore'
    - '!.git/**'
  exclude:
    - local.settings.json
    - .vscode/**

当我到处使用azure时,不知道为什么它要寻找AWS凭证。

azure serverless
1个回答
0
投票

我发现了为什么它只寻找AWS凭证的问题。 最新的无服务器版本不支持 Azure,仅适用于 AWS。 我必须降级我的无服务器版本才能使其正常工作。

npm uninstall serverless -g 
npm install -g [email protected]

不确定为什么从无服务器中删除了对 Azure 的支持,我是否应该停止使用 Azure 无服务器,以防无服务器不再与 azure 一起工作?

© www.soinside.com 2019 - 2024. All rights reserved.