What Is a Cloud Secrets Manager? Store and Rotate Credentials Safely
A cloud secrets manager stores sensitive values such as database passwords, API tokens, and certificates separately from application code and configuration files, then lets authorized workloads retrieve them at runtime. Storing a value in a vault is only part of the job: access must be limited, rotation must update the target system and application, and failures need a recovery path.
This article draws on official AWS Secrets Manager, Azure Key Vault, and Google Cloud Secret Manager documentation checked on November 19, 2026. Provider features and workflows differ; they are not assumed to be interchangeable.
What belongs in a secrets manager?
A secret is a value whose exposure could put system access or data at risk: database passwords, external API keys, application client credentials, connection strings, or certificate private keys. A service generally encrypts stored values and returns a decrypted value only after authenticating the caller and checking its permissions. Encryption at rest and control over who can read the value are separate safeguards.
A secrets manager is also different from a general configuration store and a cryptographic key management service. Nonsecret settings such as port numbers and feature flags belong in configuration management. Creating and holding encryption keys and performing cryptographic operations are KMS responsibilities. A secrets manager manages the credential values an application uses. Google explicitly distinguishes Secret Manager from Cloud KMS for these purposes; Microsoft recommends Azure App Configuration, rather than Key Vault, for general settings.
Why does runtime retrieval reduce hard-coding risk?
When a password is embedded in code, it can reach anyone who can read the repository, build tools, logs, or deployment artifacts. Configuration files and container images can also leave copies in deployment environments and backups. With a secrets manager, the application holds a secret identifier instead of the value and calls a cloud API at runtime when it needs the credential.
This does not make the design safe automatically. The cloud role or workload identity used by the application needs permission to read the secret; if that identity is compromised, an attacker may retrieve it too. Give each service only read access to the specific secrets it needs, and separate read permission from administration, rotation, and deletion. Where possible, authenticate to the manager with managed identity or short-lived credentials instead of a long-lived API key. AWS IAM roles, Azure managed identities, and Google Cloud workload identities are platform examples.
Also account for exposure after retrieval. Values may remain in process memory, environment variables, diagnostic dumps, exception messages, shell history, or CI logs. Never log the secret value. Audit who accessed it and when without recording the payload. Revoking access does not erase a value already held in a running process, so design cache and refresh behavior too.
Secret rotation changes more than the stored value
Rotation replaces an old credential with a new one. Changing only the secrets-manager value is insufficient: the database or external API must accept the new credential, and the application must switch to it. If these three states change at different times, authentication can fail.
AWS Secrets Manager offers managed rotation without Lambda for some managed credentials; other secrets can use a Lambda function that updates both the secret and the target database or service. Azure Key Vault describes combining events with Azure Functions to rotate a secret and update dependent services. Google Cloud Secret Manager provides rotation schedules and notifications, while the application’s adoption of the new version needs its own design. Enabling “automatic rotation” in a console therefore does not prove every target and running workload has switched.
Before rotation, check whether the target can accept old and new credentials at once. If it supports two credential sets, create the new value, add a secret version, then apply it to a small portion of the fleet and inspect authentication and error rates. Expand after the check and revoke the old credential last. Google describes pinning a version during deployment for gradual rollout and rollback; continuously following latest can spread a bad value service-wide immediately. If only one credential can be valid, plan for a brief update window and a recovery path.
How should you choose versions and caching?
Secret versions help distinguish changes and recover a prior value, but providers do not implement versions identically. Google Secret Manager allows access by version number. AWS Secrets Manager uses staging labels such as AWSCURRENT, AWSPREVIOUS, and AWSPENDING to indicate rotation state. Pinning a version in a deployment makes the running value reproducible and limits the spread of a bad change. Automatically following the newest version is convenient but can propagate a failed rotation quickly.
Calling the secret API on every request increases latency and request volume, and a temporary service outage may become an application authentication failure. In-memory caching reduces calls and latency but can retain an old value after rotation or permission revocation. Set cache lifetime to match the rotation objective and risk tolerance; define refresh behavior after authentication failures and recreate connection pools when needed. Revoke the old credential only after rollout and cache expiry are confirmed.
Example: changing a database password with minimal downtime
Hypothetical example: An order service gets one database user’s password from a secrets manager. First confirm whether the database authentication model permits a second user or two valid passwords. If it does, the rotation job creates the new credential, applies it to the database, and writes a new secret version. A deployment pins that version and sends it to a small group of instances; operators check connection success and database authentication errors.
After confirming normal operation, roll out to the rest of the fleet, allow caches to refresh, and recreate connection pools. Revoke the old password only after every instance uses the new version. If the rollout fails, redeploy the prior version and restore acceptance of the old password in the database. This is a generic operating pattern, not a product test or claimed automatic outcome. If the database allows only one password at a time, a zero-downtime switch cannot be assumed; plan a short maintenance window.
Choosing a service and preparing for adoption
Start with the secrets manager native to the cloud platform a workload already uses; its identity, audit, and network controls may integrate more naturally. For multicloud workloads, compare identity integration, data location, replication, rotation targets, and operations rather than standardizing on one product as an end in itself. The three services share the goal of storing secrets and controlling access, but differ in version selection, rotation automation, regional options, and billing units. Google offers regional secrets separately from its default global service, so check residency needs explicitly.
Before adoption:
Distinguish secret values from ordinary configuration and encryption keys.
Use managed identity or short-lived credentials so workloads do not need long-lived keys to authenticate.
Limit each application to the secrets it needs; separate read, rotation, administration, and deletion permissions.
Test a rotation that updates the target system and rolls out gradually to applications, including rollback.
Decide cache lifetime, behavior on errors, audit events, alerts, recovery, and regional replication.
Check that secrets do not appear in logs, CI output, images, or dumps. If a value was exposed, replace it rather than only deleting its stored copy.
A secrets manager reduces hard-coding and provides access controls; it does not replace credential rotation or application deployment. Safer operation removes long-lived credentials where possible, limits access to remaining secrets, and verifies that the target system, secret store, and application all move to the new value together.
Sources
[AWS Secrets Manager overview](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html)
[AWS Secrets Manager security best practices](https://docs.aws.amazon.com/secretsmanager/latest/userguide/best-practices.html)
[AWS Secrets Manager rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html)
[Secure Azure Key Vault secrets](https://learn.microsoft.com/en-us/azure/key-vault/secrets/secure-secrets)
[Azure Key Vault secrets overview](https://learn.microsoft.com/en-us/azure/key-vault/secrets/about-secrets)
[Azure Key Vault autorotation](https://learn.microsoft.com/en-us/azure/key-vault/general/autorotation)
[Google Cloud Secret Manager overview](https://docs.cloud.google.com/secret-manager/docs/overview)
[Google Cloud Secret Manager rotation recommendations](https://docs.cloud.google.com/secret-manager/docs/rotation-recommendations)
[Create and access secrets in Google Cloud Secret Manager](https://docs.cloud.google.com/secret-manager/docs/create-secret-quickstart)