AZURE KEY VAULT → STACKIT SECRETS MANAGER AND KMS · TUTORIAL

Azure Key Vault to STACKIT Secrets Manager and KMS

A Key Vault holds secrets, keys and certificates. STACKIT has Secrets Manager for the first and KMS for the second; for certificate renewal the run names no STACKIT service. StackToIT writes one Secrets Manager instance for the vault and lists every object, setting and access rule it does not carry. This tutorial follows a demo vault with a secret, a key and a certificate from input to a plan for each object.

One vault in, one Secrets Manager instance out

A demo estate written for this page and assessed by StackToIT on 4 November 2026: a standard-tier vault with RBAC authorization and purge protection, one secret, one RSA key and one certificate. Left: the vault, the secret and the key from the input (the certificate block is left out). Right: the resource block of the STACKIT Terraform the engine wrote; the review comments above it in the file are left out here.

Example inputmain.tf
resource "azurerm_key_vault" "shop" {
  name                       = "kv-shop-gwc"
  location                   = azurerm_resource_group.sec.location
  resource_group_name        = azurerm_resource_group.sec.name
  tenant_id                  = data.azurerm_client_config.current.tenant_id
  sku_name                   = "standard"
  soft_delete_retention_days = 30
  purge_protection_enabled   = true
  rbac_authorization_enabled = true
}

resource "azurerm_key_vault_secret" "db_password" {
  name         = "orders-db-password"
  value        = var.db_password
  key_vault_id = azurerm_key_vault.shop.id
}

resource "azurerm_key_vault_key" "data" {
  name         = "data-encryption-key"
  key_vault_id = azurerm_key_vault.shop.id
  key_type     = "RSA"
  key_size     = 2048
  key_opts     = ["decrypt", "encrypt", "wrapKey", "unwrapKey"]
}
STACKIT Terraform by StackToITterraform/security.tf
resource "stackit_secretsmanager_instance" "migrated_secrets" {
  project_id = var.project_id
  name       = "migrated-secrets"
}
  • The instance is all the draft writes

    The run creates the Secrets Manager instance and nothing inside it. The comments state that no setting of the vault, its name, tenant, SKU, access rules, network rules or retention, is generated, and that each secret is recreated as a key in the instance.

  • Values never enter the draft

    The secret value comes from a sensitive variable in the source. The run writes no value, and the critical setting about vault objects says a person puts each secret into the instance.

  • Keys and certificates are decisions

    A key's type, size and operations are chosen on a KMS key; certificates have no STACKIT counterpart for issuance or renewal. The draft names both as not carried.

How the run classifies the vault

Excerpt of assessment.json for the vault unit (id, class, confidence and target of its result, values as written), then selected comment lines of terraform/security.tf, verbatim.

StackToIT assessment (excerpt)assessment.json
{
  "id": "azurerm_key_vault.shop",
  "result": {
    "class": "RECONFIGURE",
    "confidence": "MEDIUM",
    "target": {
      "service": "STACKIT Secrets Manager (+ KMS for keys)",
      "resources": [
        "stackit_secretsmanager_instance",
        "stackit_secretsmanager_user"
      ]
    }
  }
}
Comment lines in the draftterraform/security.tf
# NOT CARRIED (azurerm_key_vault_key.data): key_opts, key_size = 2048, key_type = RSA, key_vault_id, name = data-encryption-key — a setting of azurerm_key_vault.shop: recreate its secrets as secrets in the Secrets Manager instance; none of the vault's settings (name, tenant, SKU, access policies, network rules, retention) is generated.
# NOT CARRIED (azurerm_key_vault_secret.db_password): key_vault_id, name = orders-db-password, value — a setting of azurerm_key_vault.shop: recreate its secrets as secrets in the Secrets Manager instance; none of the vault's settings (name, tenant, SKU, access policies, network rules, retention) is generated.
# azurerm_key_vault.shop: WARNING kv-certificates: Certificates (possibly auto-renewed by Key Vault) are stored in the vault; STACKIT has no certificate-lifecycle service, so renewal moves to the load balancer certificate upload or cert-manager.
# azurerm_key_vault.shop: WARNING kv-access-model: Access is granted to Entra principals (access policies or Azure RBAC); on STACKIT access is granted to Secrets Manager users or service accounts, so every consumer gets new credentials.
  • RECONFIGURE, not a copy

    The class is RECONFIGURE with MEDIUM confidence. Applications switch from the Key Vault SDK or references to a Vault client or injection by the platform, and from Entra principals to Secrets Manager users.

  • Ten open settings, three owners

    decisions.json holds ten open critical settings in three records. The Identity Architect owns five: access model, deletion protection, resource-group scope, tenant and vault objects. The Platform Architect confirms four names, of the vault, the secret, the key and the certificate; the Security Architect owns the certificates. Deletion protection is refused outright: the run finds no STACKIT counterpart, so a redesign or an accepted difference has to settle it.

Where each Key Vault object goes

Key Vault objectSTACKIT targetWhat the run says
VaultSecrets Manager instanceGenerated as a shared instance for all migrated secrets
SecretA key in the instance (KV2 store)Value is set by a person; not written in the draft
Key (RSA 2048)KMS keyring and keyNot generated; non-exportable keys are re-created, not copied
CertificateLoad balancer certificate upload or cert-managerRenewal moves; STACKIT has no certificate-lifecycle service
RBAC or access policySecrets Manager users or service accountsEvery consumer gets new credentials
Soft delete and purge protectionVersion limit and your own backupIndividual secrets cannot be restored from backup

Classes and wording as the run decided them. The secret, key and certificate are part of the vault unit.

The migration in order

  1. Inventory the vault

    List the secrets, keys and certificates, and the consumers of each. The run lists the objects of the Terraform; objects created outside it are not seen.

  2. Create the instance

    Apply the generated instance in a test project first. The provider documents the Secrets Manager resources only for a provider configured with default_region eu01.

  3. Move secrets

    STACKIT states compatibility with HashiCorp Vault KV2 and one secrets engine. Write each value with the Vault CLI as STACKIT’s how-to shows, for example vault kv put -mount=<instance ID> orders-db-password value=…, and set a version limit, because billing counts secret versions.

  4. Create keyrings and keys

    Create a keyring, then each key with an algorithm and purpose KMS lists. KMS accepts imported key material, but the run says non-exportable Azure keys are re-created.

  5. Replace certificate handling

    Upload to the load balancer or run cert-manager on a cluster. Plan renewal as work, since nothing renews the certificate for you.

  6. Issue new access

    Give each consumer a Secrets Manager user. The password is generated, cannot be changed, and a new one needs a new user.

Keyring, key and a read-only user, by hand

  • Keyring first

    stackit_kms_keyring needs a project_id and a display_name. The draft writes no keyring; you add it once the key decisions are made.

  • Then the key

    stackit_kms_key needs keyring_id, display_name, protection, algorithm and purpose; the provider's example uses the protection software. For the demo's RSA 2048 encryption key the closest listed values are rsa_2048_oaep_sha256 with the purpose asymmetric_encrypt_decrypt.

  • Check the key fit

    The Azure key allows encrypt, decrypt, wrapKey and unwrapKey. As of November 2026 STACKIT KMS lists aes_256_gcm and RSA OAEP variants (2048, 3072 and 4096 bit with SHA-256, 4096 bit with SHA-512) for encryption and decryption. Whether one of them meets the way your code wraps data keys is yours to verify before any cutover.

  • Generate or import

    KMS lets you decide per key or key version whether the material is generated or imported, and states that exporting keys is not intended. Keys that never leave KMS are re-created, as the run says for non-exportable Azure keys.

  • A read-only consumer

    stackit_secretsmanager_user with write_enabled set to false gives an application read access only. Its password is generated by the service and returned as a sensitive attribute.

  • Destroy does not delete

    On destroy the provider schedules a key for deletion and only removes a keyring from the state. Treat both as long-lived resources.

Questions security teams ask

Can we restore a deleted secret?

Not from backup. STACKIT states that individual secrets cannot be restored and that the backup serves disaster recovery. Overwritten secrets survive as older versions when the version limit is above one, so keep an external copy of values if you rely on recovery from deletion.

Does KMS replace Key Vault keys one to one?

Not as a copy. KMS lists a set of algorithms and purposes and allows import, but the run treats exportable and non-exportable keys differently and asks for a decision per key.

What happens to certificates?

STACKIT has no certificate-lifecycle service according to the run. Renewal moves to the load balancer upload or to cert-manager.

Which applications change?

Those that call the Key Vault SDK or use Key Vault references. They switch to a Vault client or to injection by the platform, for example External Secrets Operator on a cluster.

Sources

Your next move: STACKIT.

Tell us about your estate. We show you what StackToIT delivers for it: target architecture, Terraform artifacts and a structured migration plan.