[英]Terraform and Azure: Unable to provision Storage Account
我正在嘗試配置一個存儲帳戶,但運行它會導致錯誤:
Error: Error reading static website for AzureRM Storage Account "sa12345461234512name":
accounts.Client#GetServiceProperties:
Failure responding to request: StatusCode=403 -- Original Error: autorest/azure:
Service returned an error. Status=403 Code="AuthorizationPermissionMismatch"
Message="This request is not authorized to perform this operation using this permission.\n
RequestId:05930d46-301e-00ac-6d72-f021f0000000\n
Time:2020-03-02T09:09:44.9417598Z"
運行操作系統 Windows 10 專業版。
復制步驟(在安裝了 Azure CLI 的 Powershell 中)
配置文件內容
# Configure the Azure Provider
provider "azurerm" {
version = "=2.0.0"
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "Australia East"
}
resource "azurerm_storage_account" "example" {
name = "sa12345461234512name"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "staging"
}
}
不確定我缺少什么,所有其他資源都可以正常工作,只是存儲帳戶。
這是 azure 提供程序中的一個錯誤,請參閱: https : //github.com/terraform-providers/terraform-provider-azurerm/issues/5869
更新您的提供商; 它似乎與 terraform 版本無關。
從:
# Configure the Azure Provider
provider "azurerm" {
# whilst the `version` attribute is optional, we recommend pinning to a given version of the Provider
version = "=2.0.0"
features {}
}
到:
provider "azurerm" {
version = "~> 2.1.0"
features {}
}
只是為了補充這一點,因為以上都沒有奏效。 在我的情況下,它首先不起作用,然后第二天工作只是為了在晚上不再工作......沒有改變版本或任何東西,是同一台電腦。
事實證明,我在 Windows 中運行的 Ubuntu 上的時間設置有偏差。 只需運行sudo ntpdate time.nist.gov
來更新時間即可解決問題。
發現問題。 它與 Terraform 有關。 剛剛檢查了更新並通知 0.12.21 已發布(我正在運行 0.12.20)。
似乎如果運行 AzureARM 2.0.0 那么真的需要最小 0.12.21 才能使其工作。
與@tesharp遇到的問題相同。 在我的 Ubuntu WSL2 上,以下命令解決了這個問題:
sudo hwclock -s
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.