microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.7k stars 1.41k forks source link

Error x509: certificate signed by unknown authority - Azure key Vault with Terraform #1681

Open Didjacome opened 1 year ago

Didjacome commented 1 year ago

Steps to Reproduce:

  1. Create folder for Dev Container image

  2. Created simple main.tf and opened in VS code image image

  3. Configuring main.tf file for execution image

provider "azurerm" {
  features {
    key_vault {
      purge_soft_delete_on_destroy = true
    }
  }
  subscription_id = "000000-000000-000000-000000-000000000"
  tenant_id       = "000000-000000-000000-000000-000000000"
  client_id       = "000000-000000-000000-000000-000000000"
  client_secret   = "000000-000000-000000-000000-000000000"
}

data "azurerm_client_config" "current" {}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "random_string" "random" {
  length  = 4
  special = false
  numeric = false
}

resource "azurerm_key_vault" "example" {
  name                        = lower(join("", ["keyvault", random_string.random.result]))
  location                    = azurerm_resource_group.example.location
  resource_group_name         = azurerm_resource_group.example.name
  enabled_for_disk_encryption = true
  tenant_id                   = data.azurerm_client_config.current.tenant_id
  soft_delete_retention_days  = 7
  purge_protection_enabled    = false

  sku_name = "standard"

  access_policy {
    tenant_id = data.azurerm_client_config.current.tenant_id
    object_id = data.azurerm_client_config.current.object_id

    key_permissions = [
      "Get",
    ]

    secret_permissions = [
      "Get",
    ]

    storage_permissions = [
      "Get",
    ]
  }
}
  1. Creating dev container image image image image
    • Select features to install
Modules Version
Azure CLI latest
Git latest
Python latest
Terraform latest

image

  1. Select Reopen in Container

image

  1. Dev Container Created successfully image

  2. Terraform init image

  3. Terraform Plan image

  4. Terraform Apply image

Error x509: certificate signed by unknown authority

image

Azure

Other tests done

Considerations

Everything leads me to think that something is missing inside the container but I could not identify it.

Link from some forums, but no solution found :

Didjacome commented 1 year ago

problem is still occurring

Didjacome commented 1 year ago

problem is still occurring

Didjacome commented 1 year ago

problem is still occurring

Didjacome commented 1 year ago

problem is still occurring