本文介绍了Terraform 后端到 azure blob 存储错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用以下内容成功地在 Azure 存储中为 terraform 创建后端状态文件,但由于某种原因它停止工作.我已经回收了存储密码,尝试了两个密钥并每次都得到相同的错误

I have been using the below to successfully create a back-end state file for terraform in Azure storage, but for some reason its stopped working. I've recycled passwords for the storage, trying both keys and get the same error every-time

backend.tf

    terraform {
    backend "azurerm" {
        storage_account_name    = "terraformstorage"
        resource_group_name     = "automation"
        container_name          = "terraform"
        key                     = "testautomation.terraform.tfstate"
        access_key              = "<storage key>"
    }
}

错误返回

地形初始化
正在初始化后端...
成功配置后端azurerm"!Terraform 将自动除非后端配置更改,否则请使用此后端.
刷新状态时出错:存储:服务返回错误:StatusCode=403,ErrorCode=AuthenticationFailed,ErrorMessage=Server 未能对请求进行身份验证.确保 Authorization 标头的值正确形成,包括签名.RequestId:665e0067-b01e-007a-6084-97da67000000
时间:2018-12-19T10:18:18.7148241Z,RequestInitiated=Wed,2018 年 12 月 19 日 10:18:18 GMT,RequestId=665e0067-b01e-007a-6084-97da67000000,API 版本=,QueryParameterName=,QueryParameterValue=

任何想法我做错了什么?

Any ideas what im doing wrong?

推荐答案

对我有用的是删除本地 .terraform 文件夹,然后重试.

What worked for me is to delete the local .terraform folder and try again.

这篇关于Terraform 后端到 azure blob 存储错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 03:23