Join our Newsletter — 33% off our NHI Course
Home› Guides› Cloud Key Vaults for Beginners: AWS Secrets Manager,…
Guide Cloud Security

Cloud Key Vaults for Beginners: AWS Secrets Manager, Azure Key Vault and Google Secret Manager

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 11 min read
On this page

A cloud key vault is a managed service that stores passwords, keys and tokens so apps fetch them when needed.

This guide is for developers, IT staff and anyone new to cloud who keeps hearing "put it in the vault". It covers AWS Secrets Manager, Azure Key Vault and Google Secret Manager. Platforms are listed alphabetically, and the order is not a ranking.

In short

  • A vault keeps secrets out of code. The app asks the vault for each secret while it runs.
  • Each cloud has its own service, and each one controls who can read a secret through that cloud's identity system.
  • Each service encrypts what it stores and can log who reads it.
  • Rotation means swapping a secret for a new one on a schedule. Each cloud offers a way to set that up.

What you will learn

  • Explain what a cloud key vault is and why it beats a password in code.
  • Name what each of the three services stores.
  • Describe how access, encryption and logging work at a basic level.
  • Describe how rotation is set up on each platform.
Hidden value (secret)
a password, API key, token or similar value that proves an app may use something.
Safe deposit box (vault)
the cloud service that stores secrets and hands them out to allowed callers.
Swap on a schedule (rotation)
replacing a secret with a new one, so an old copy stops working.

What is a cloud key vault?

Think of a bank's safe deposit room. You do not carry your valuables around. You leave them in a box, and staff check who you are before they open it.

A cloud key vault works the same way for app secrets. The app does not keep a password in its code. It asks the vault at run time, and the vault checks the app's identity first [1].

The three big clouds each offer one:

  • AWS Secrets Manager stores database and app credentials, OAuth tokens, API keys and other secrets [1].
  • Azure Key Vault stores secrets, encryption keys and TLS certificates [2].
  • Google Secret Manager stores secret values such as API keys, passwords and certificates, each kept as numbered versions [4].

Where the comparison stops working: a bank box holds one thing until you visit. A vault secret can be read many times a minute by many apps, so who may read it matters a great deal.

For the wider idea, see Secrets Management for Beginners.

Why does it matter?

Secrets written into code or config files get copied, shared and forgotten. A vault gives one place to control, log and change them.

If you write code

What could happen: a database password in your code ends up in a shared repository.

Check this: search your project for passwords and keys, and move them into the vault.

Next: Environment Variables and .env Files for Beginners

If you run cloud accounts

What could happen: one broad permission lets every app read every secret in the account.

Check this: give each app read access to its own secrets only.

Next: Cloud Permissions and CIEM for Beginners

If you are new to security

What could happen: a leaked secret keeps working for years because nobody ever changes it.

Check this: ask which secrets have rotation set up, and which never change.

Next: Leaked Secret Response for Beginners

What does it look like?

Here is a made-up app setting file. It names a secret in a vault instead of holding the password itself.

Example only. All values are made up.

app:        EXAMPLE-orders-service                 (1)
db_host:    db.example.invalid                     (2)
db_user:    orders_app                             (3)
db_secret:  vault reference "EXAMPLE/orders-db"    (4)
# db_password: FAKE-0000                           (5)
  1. The app that needs the secret.
  2. In a real file, this line would contain the database server's address.
  3. The database user name. This is not secret on its own.
  4. The name of the secret in the vault. The app fetches the value at run time.
  5. The old way: a password typed into the file. It is commented out here and should be deleted.

Why this is risky: a password typed into a file is copied wherever the file goes, and changing it means editing every copy.

The safer way: keep only the secret's name in the file, and let the app read the value from the vault.

How does it work?

  1. Store the secret. An admin puts the value in the vault. Each service encrypts it at rest [1][2][4].
  2. Grant access. The cloud's identity system decides which apps and people may read it.
  3. Fetch at run time. The app proves who it is, then asks for the secret by name.
  4. Log each read. The cloud's logging service records who asked and when.
  5. Rotate. On a schedule, a new value replaces the old one. Apps pick up the new value on their next fetch.
Diagram titled How an app gets a secret from a cloud vault. Four boxes in a row with arrows: App starts and has no password in its code; Proves who it is using the cloud's identity system; Vault checks access rules and returns the secret; Every read is logged. A note underneath lists the three services alphabetically: AWS Secrets Manager, Azure Key Vault and Google Secret Manager, and says rotation swaps the value on a schedule.
Figure 1. The same basic flow applies on all three clouds.

AWS Secrets Manager

Access: controlled with IAM permission policies. These can be attached to a user, group or role, or to the secret itself [6]. AWS points to AWS KMS for encryption keys and AWS Certificate Manager for certificates [1].

Encryption and logs: secrets are encrypted with an AWS managed key or your own KMS key. With AWS CloudTrail turned on, API calls are logged [1].

Rotation: you can set an automatic rotation schedule. Apart from managed rotation, an AWS Lambda function does the rotation [1].

Azure Key Vault

Access: callers sign in through Microsoft Entra ID. Access is granted with Azure role-based access control or a Key Vault access policy [2].

Encryption and logs: all vaults are encrypted at rest using keys held in hardware security modules. You can send vault logs to storage, an event hub or Azure Monitor [2].

Rotation: thirty days before a secret expires, Key Vault sends a near-expiry event. A function you set up can then create a new version [3].

Google Secret Manager

Access: controlled with fine-grained IAM roles and conditions. You can split the jobs of reading, managing and rotating secrets [4].

Encryption and versions: secrets are encrypted in transit and at rest by default. Each change is a new version, so you can roll back [4].

Rotation: you set a rotation time or period. Secret Manager then sends a message to Pub/Sub, and your subscriber creates the new version [5].

A worked example

This story is made up to show the idea.

Nils Zamora is a developer at a small online shop. The shop runs one app on each of the three big clouds after a few years of growth.

A colleague, Gideon Tanaka, finds the same database password written into three config files. It has not changed in four years.

Nils moves each password into the vault on that app's own cloud. He uses AWS Secrets Manager, Azure Key Vault and Google Secret Manager. Each config file now holds only the secret's name.

Next he sets access. Each app's identity may read its own secret and nothing else. Nils and Gideon keep admin rights, but their reads are logged.

Then Nils sets up rotation. On AWS he picks a schedule with a rotation function. On Azure he sets an expiry date and a function for the near-expiry event. On Google he sets a rotation period and a Pub/Sub subscriber.

He tests each one in a test project first. One app kept the password in memory for days, so it failed after rotation. Nils changes it to fetch the password again when the database rejects it.

Finally Gideon deletes the old passwords from the config files and from the repository history.

Nils learned that a vault is only half the job. Narrow access, logs and tested rotation make it work.

Myths and mistakes

What people thinkWhat is true
Once a secret is in a vault, it is safe.It is only as safe as the access rules. Anyone allowed to read it can still leak it.
The vault changes my passwords for me.Rotation has to be set up, and on each cloud you supply the logic that makes the new value.[1][3][5]
Moving a secret to the vault removes the old copy.Old copies stay in files and code history until someone deletes them and changes the value.
One vault for everything is simplest and fine.Azure suggests a vault per application, so secrets stay limited to one app and team.[2]
Vault logs are on and watched by default.Logging has to be turned on or routed somewhere, and someone has to look at it.[1][2]

What can I do this week?

  • Search one project for passwords or keys typed into code or config.
  • List who can read secrets in one cloud account, and remove anyone who does not need it.
  • Check that vault logging is turned on and sent somewhere people look.
  • Pick one secret that never changes and plan how to rotate it.

Checklist

  • No passwords or keys are typed into code or config files.
  • Each app can read only its own secrets.
  • Vault access is logged, and the logs are kept.
  • Important secrets have rotation set up and tested.
  • Apps fetch the secret again if a sign-in with it fails.
  • Old copies are removed from files and code history.
  • Each secret has a named owner.

Common questions

Is a key vault the same as a key management service?

Not quite. Azure Key Vault holds secrets, keys and certificates in one service. AWS points to AWS KMS for encryption keys, and Google points to Cloud KMS for them. Their secrets services hold values such as passwords and API keys.[1][2][4]

How does the app prove who it is to the vault?

Through the cloud's own identity system. On Azure, that is Microsoft Entra ID. On AWS and Google, it is each cloud's IAM. A cloud-managed identity for the app avoids keeping yet another password just to open the vault.[2][6][4]

What happens to old versions of a secret?

Google Secret Manager keeps each change as a version. You can roll back to a known good one, or disable and destroy versions you no longer need. This helps if a new value breaks something.[4]

Can rotation break my app?

Yes, if the app holds the old value too long. Azure's own guide notes a short window when the vault has the new password but the database does not yet. Test rotation first, and make apps fetch again on failure.[3]

Do I need all three services?

No. Use the vault on the cloud where the app runs. Teams that use more than one cloud often end up with more than one vault. The habits stay the same: narrow access, logging and rotation.

Where next?

Ready for the detail? Read the practitioner guide: Secrets Management Guide. It covers storing, sharing, rotating and auditing secrets in depth.

Also useful:

Related NHI Mgmt Group resources: Environment Variables and .env Files for Beginners, Leaked Secret Response for Beginners and Hardware Security Modules for Beginners.

Key terms

Secrets management
The discipline of securely storing, distributing, rotating and auditing secrets across systems.
AWS Secrets Manager
An AWS service for storing, retrieving and rotating secrets such as passwords, API keys and database credentials.
Azure Key Vault
An Azure service for storing secrets, encryption keys and certificates, with access controlled through Microsoft Entra ID.
Google Secret Manager
A Google Cloud service for storing and delivering secret values, kept as versions and controlled with IAM.
Hardcoded secret
A credential written directly into source code, scripts or config files.
Least privilege
Giving each user, process or system only the access it needs, for only as long as it needs it.

Sources and further reading

  1. Amazon Web Services, "What is AWS Secrets Manager?", AWS Secrets Manager User Guide. https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html (accessed 1 Dec 2026).
  2. Microsoft, "About Azure Key Vault", Microsoft Learn. https://learn.microsoft.com/en-us/azure/key-vault/general/overview (accessed 1 Dec 2026).
  3. Microsoft, "Automate the rotation of a secret for resources that use one set of authentication credentials", Microsoft Learn. https://learn.microsoft.com/en-us/azure/key-vault/secrets/tutorial-rotation (accessed 1 Dec 2026).
  4. Google Cloud, "Secret Manager overview", Secret Manager documentation. https://docs.cloud.google.com/secret-manager/docs/overview (accessed 1 Dec 2026).
  5. Google Cloud, "About rotation schedules", Secret Manager documentation. https://docs.cloud.google.com/secret-manager/docs/secret-rotation (accessed 1 Dec 2026).
  6. Amazon Web Services, "Authentication and access control for AWS Secrets Manager", AWS Secrets Manager User Guide. https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.