Azure DevOps Terraform Init - 远程状态 - 无法获取现有工作区:containers.Client#ListBlobs:发送请求失败:StatusCode=0

Azure DevOps Terraform Init - Remote State - Failed to get existing workspaces: containers.Client#ListBlobs: Failure sending request: StatusCode=0

这一次体验 Terraform,我正在按照此 link 中的文档将我的 Terraform 文件放入我使用 Azure DevOps 的发布管道中。一切都运行得很好,直到它初始化地形的步骤。它失败并显示以下错误消息:

存储帐户本身已配置,其密钥也已根据文档成功保存在环境变量中。

我在 Azure DevOps 发布管道中为 terraform init 使用的 YAML 是:

backend serviceterraform 脚本是:

变量作为环境变量存储在发布管道中,并且有一个 replace token 任务将 __ 替换为空字符串:

她是管道中创建资源组和存储帐户的步骤:

最后,PS 将存储密钥存储在 ENV 变量中的脚本:

此外,我无法理解为什么错误消息中的 get http 会附加 envterraform.tformstate

我 运行 不知道为什么它因该异常而失败以及实际期望的是什么。

我一直在谷歌搜索,但到目前为止一直未能解决问题。在此感谢您 help/thoughts。

您似乎将变量的 storageaccount 拼错了。所以这个值没有被替换。你有 sotrageaccount。 t 和 o 交换。

虽然 Christian Pearce 确实回答了紧迫的问题,但此消息存在基线问题。
您的存储帐户设置有问题

我遇到的问题是我将路径信息放入容器名称

- task: TerraformTaskV3@3
  displayName: Terraform Init
  inputs:
    provider: azurerm
    command: init
    backendServiceArm: [service connection]
    backendAzureRmResourceGroupName: [resource group]
    backendAzureRmStorageAccountName: [storage account name]
    backendAzureRmContainerName: [container]/subfolder <-- This is bad and belongs in the Key field
    backendAzureRmKey: ${{ parameters.name }}/${{ parameters.environment }}.tfstate
    workingDirectory: $(Pipeline.Workspace)/Infrastructure