Azure Cloud Series: This lesson is part of our comprehensive Complete Microsoft Azure Tutorial: Learn Azure from Beginner to Advanced.

Encryption helps protect data by transforming it so that it cannot be understood without the required cryptographic key or process. In Azure, encryption can protect data at rest, in transit, and in some processing scenarios, depending on the service and workload. Key management determines how cryptographic keys are generated, stored, accessed, rotated, backed up, and retired.

Many Azure services encrypt stored data by default with platform-managed keys. Some workloads require or benefit from customer-managed keys, which provide additional control over key lifecycle and access but also introduce responsibilities. The correct approach depends on threat model, regulatory or contractual requirements, service support, recovery needs, and operational capability.

This guide introduces encryption types, platform-managed and customer-managed keys, key rotation, access control, service integration, common mistakes, troubleshooting, and a practical method for documenting an encryption design.

What You Will Learn

  • What encryption at rest and in transit mean
  • How platform-managed keys differ from customer-managed keys
  • How keys, key-encryption keys and data-encryption keys relate
  • How Azure Key Vault and Managed HSM support key management
  • How to plan access, rotation, recovery and audit
  • How encryption settings affect cost and operations
  • How to validate encryption controls for a workload

1. What Is Azure Encryption and Key Management?

Azure encryption uses cryptographic mechanisms to help protect data stored by services and transmitted between components. The service and workload determine which encryption options are available. Platform-managed keys allow Microsoft to operate much of the key lifecycle for supported services. Customer-managed keys let an organization control additional aspects of key lifecycle and access through supported key-management services, but require ownership of availability, permission, rotation and recovery procedures.

2. Why Does It Matter?

Encryption reduces the usefulness of data to someone who obtains storage or intercepts a connection without the required key or authorization. It is only one layer of data protection. Strong identity, access controls, network security, secure application design, backup, and monitoring remain necessary. Key management is especially important because a key can protect data effectively only while it remains available to authorized workloads and inaccessible to unauthorized identities.

3. Key Concepts and Terminology

Data at rest is data stored on disks or in managed storage. Data in transit is data moving across networks. A data-encryption key (DEK) encrypts the content, while a key-encryption key (KEK) may protect or wrap the DEK in supported designs. Platform-managed keys are operated by the service provider. Customer-managed keys are controlled by the customer through supported key services. Rotation replaces or updates key material according to a defined policy and service behavior.

4. How Does It Work?

First identify the data stores, data flows and applicable requirements. Confirm what encryption the Azure service provides by default, then determine whether customer-managed keys are required. If supported, create or reference the key using an approved key-management service, configure a narrowly scoped identity and permissions, and associate the key with the resource according to current service instructions. Verify the resulting encryption configuration, logging, key version behavior, and recovery plan before production use.

5. Planning and Design Considerations

Inventory sensitive data, classification, storage and transit paths, service capabilities, key ownership, rotation expectations, separation-of-duties needs, data residency and audit requirements. Decide who can create, rotate, disable and recover keys. Consider how services behave if the key becomes unavailable or access is revoked. Customer-managed key control adds operational dependencies, so include alerting, backup, permissions, change management, and incident response in the design.

A short decision checklist

  • Write down the requirement that Azure encryption and key management must meet and the consequences if it is misconfigured.
  • Confirm the relevant Microsoft Entra, Azure service, SKU, scope, and regional prerequisites before making changes.
  • Review owner, approval path, monitoring, recovery, and ongoing operating cost before rollout.

6. A Practical Architecture Example

A storage workload may use platform-managed encryption by default. If policy requires control of the encryption key, the organization can evaluate supported customer-managed key options through Azure Key Vault or Managed HSM. The workload identity needs appropriate access to the key service, and operators must maintain the key’s lifecycle. If the key is disabled, deleted, or inaccessible, dependent service operations may be disrupted, so changes should be tested and recovery options documented.

Simplified flow

Classify data → Select service encryption option → Manage key lifecycle → Verify access and audit → Test recovery

7. Where Is It Used?

Encryption and key management are used for storage accounts, disks, databases, backup data, application secrets, certificates, and other sensitive workloads. Customer-managed keys can be relevant where policy requires customer control or key lifecycle evidence. Different services support different key options and restrictions, so the team should use service documentation instead of assuming a single encryption setting covers every data store and integration.

8. How It Fits with Other Azure Services

Encryption relies on identity, key services, resource configuration, network connectivity, audit and backup. Azure Key Vault can manage keys for supported integrations, while Managed HSM addresses specialized hardware-protected key requirements. Azure RBAC or key-specific access controls determine who can manage or use keys. Monitoring helps detect changes, and recovery procedures make sure encrypted data remains recoverable. The design must consider the complete lifecycle, not just the encryption toggle.

Key or encryption concept Purpose
Encryption at rest Protects stored data
Encryption in transit Protects data moving across supported network connections
Platform-managed key Key lifecycle is managed by the Azure service/provider
Customer-managed key Customer controls selected key lifecycle aspects through a supported key service
Key Vault / Managed HSM Provides key-management options and access controls
Rotation and recovery Keeps key lifecycle controlled and protects against loss or disruption

9. Advantages

Encryption helps protect stored and transmitted data, supports confidentiality requirements, and provides a foundation for compliance controls. Platform-managed keys reduce operational overhead for supported services. Customer-managed keys can provide additional control over permissions, rotation and key lifecycle evidence. Standard key practices also improve documentation because teams can explain where keys live, which identities can use them, and what happens when a key is rotated or retired.

10. Limitations and Trade-Offs

Encryption does not prevent an authorized but malicious user or compromised application from reading plaintext through legitimate permissions. Customer-managed keys create dependencies: the resource may require key access and availability to operate correctly. Service support varies by Region, tier, data type and configuration. Rotation behavior may differ between services; a changed key version does not necessarily mean every existing item was re-encrypted in the same way. Verify current documentation for the exact resource type.

11. Security Considerations

Use least privilege for key administrators and workload identities. Separate key management from ordinary data administration where feasible, protect recovery procedures, monitor high-impact key changes, and set rotation expectations according to risk and service support. Avoid copying key material into source control or unapproved storage. Review who can disable or delete keys, and use soft-delete and purge-protection capabilities where supported and appropriate to reduce accidental or malicious destruction risk.

12. Cost and Resource Planning

Platform-managed keys typically reduce key-management overhead; customer-managed approaches may introduce charges for key operations, vault or HSM usage, monitoring, and administration depending on the service and tier. They can also increase engineering effort for rotation, access reviews, and recovery testing. Choose customer-managed keys because a specific control or requirement justifies them, and estimate the complete lifecycle cost rather than just the key service line item.

13. Availability, Performance and Reliability

Key availability is part of workload availability when a service depends on an external key service. Document which operations fail if a key is disabled, access is removed, or a key service becomes unreachable. Monitor expiration and configuration alerts, back up or recover key material according to supported features, and test rotation and restore procedures. Key recovery should be designed before production because encrypted data can be difficult or impossible to recover if key material is lost.

14. Common Mistakes to Avoid

Common mistakes include assuming all data encryption options are identical, enabling customer-managed keys without a clear owner, granting broad key permissions, disabling an old key before dependents are migrated, and failing to test recovery. Teams may also confuse encryption at rest with access control or forget to secure data in transit. A key should never be removed just because its rotation is complete until dependencies and retention requirements are verified.

15. Troubleshooting and Diagnosis

When a resource cannot use its key, check the key URI and version, key status, vault firewall or network rules, identity used by the Azure service, role or access policy, and any recent permission or rotation change. Review service diagnostics and Key Vault logs where available. If access was intentionally removed, restore only the required permission after confirming ownership. For encryption compliance, verify the actual resource setting and service support instead of relying only on a policy label.

16. Getting Started with a Safe Practice Project

Choose a non-production data resource and document the encryption mode it uses by default. Review the service’s supported customer-managed key requirements without changing a production resource. If building a lab, create a dedicated key, configure a test identity, enable appropriate logs, and simulate a carefully controlled rotation or access change. Confirm how the resource behaves, document the rollback and recovery steps, and clean up in the correct order.

Frequently Asked Questions

What is encryption at rest?

It is encryption applied to data while it is stored, such as on disks or within a storage service.

Are Azure services encrypted by default?

Many Azure services provide encryption at rest by default, but capabilities and settings vary by service. Verify the specific service documentation.

What is the difference between platform-managed and customer-managed keys?

Platform-managed keys are handled by the service provider. Customer-managed keys give the customer additional control over key lifecycle and access, with added responsibility.

Does encryption replace access control?

No. Encryption is one layer of protection. Identity, authorization, network controls, application security and monitoring are still necessary.

What happens if a customer-managed key is disabled?

A dependent service may be unable to perform operations that require the key. The effect depends on the service, so test key changes and recovery procedures before production.

How should encryption keys be rotated?

Use the service-supported rotation process, confirm dependencies and version behavior, monitor the result, and do not retire old keys until the service and retention requirements permit it.

Conclusion

Azure encryption is effective only when the key lifecycle and access model are designed alongside the data architecture. Begin with the service’s built-in protections, add customer-managed keys when a clear requirement justifies the added responsibility, and document who can use or change keys. Test rotation, loss-of-access and recovery scenarios before production, because key errors can affect both confidentiality and availability.

17. How This Topic Fits into an Azure Application

Draw the flow from the data store to the encryption configuration and key service. Identify whether the service handles keys by default or depends on a customer-managed key, which identity accesses the key, and how that access is audited. Mark where encryption in transit is required and how backups or replicated data are protected. Include the impact of disabling, rotating or restoring a key in the operational design.

18. Azure Portal, CLI, SDKs and Infrastructure as Code

Use Microsoft Learn to verify which encryption options a service supports, then inspect the actual Azure resource configuration in the portal or through supported APIs and CLI tools. Use Key Vault or Managed HSM capabilities according to the workload requirements. Keep key-related configuration in reviewed deployment definitions while keeping secret material out of source control. Automate monitoring for expiration, access changes and other key events where supported.

19. Cost Awareness

Compare default encryption with customer-managed key requirements and include vault or HSM usage, API operations, logging, support, administration and testing. Review whether the control requirement applies to all data or only a defined classification. Avoid unnecessary separate key infrastructure that offers no required benefit. In cost reviews, consider the operational cost of key outages, rotation errors, and recovery as well as direct service charges.

20. Security Fundamentals

Document key owners, permitted users and workload identities, rotation policy, key recovery, deletion safeguards, and audit retention. Restrict who can change access or disable and delete keys. Use separation of duties for high-impact environments where appropriate, and test privileged changes in a lab. Revisit the policy when data classification or regulatory requirements change and confirm that the resource’s live configuration still meets the intended control.

21. Additional Limitations and Operational Considerations

Assign operational ownership for creating keys, granting access, monitoring events, rotating versions, and retiring old keys. Keep runbooks for access failure, accidental disablement, and recovery. Test the process before the team depends on it, and ensure emergency access does not become a permanent broad role. When key ownership changes, transfer documentation and operational responsibilities rather than simply changing a contact field.

Learn encryption at rest and in transit, then understand platform-managed versus customer-managed keys. Inspect the default encryption settings on a non-production resource. Study Key Vault, key versions, permissions and recovery safeguards. Next, review how one selected service uses a customer-managed key and test the documented rotation process in a lab. Finish by writing a short key lifecycle policy and recovery runbook.

1. Learn encryption at rest and in transit

2. Compare platform-managed and customer-managed keys

3. Verify encryption support for the selected Azure service

4. Study Key Vault, access control and key lifecycle safeguards

5. Test rotation and recovery in a non-production environment

23. Service Selection and Architecture Thinking

Use platform-managed keys when they satisfy requirements and reduce operational complexity. Choose customer-managed keys when a valid control, regulatory, or business need demands additional customer control and the team can operate the lifecycle. Managed HSM may fit specialized key-protection requirements, but it adds cost and operational considerations. Verify service feature support and the exact control offered; do not assume every service uses keys identically.

24. Scalability and Performance

As the number of protected resources grows, standardize key names, ownership, rotation expectations, access assignment, alerting and lifecycle documentation. Reuse established patterns only when the resources share the same governance requirement and failure domain. Avoid a design where too many unrelated workloads depend on a single key without understanding the impact. Monitor key usage and access changes, and make it possible to identify all resources affected by a key event.

25. Reliability and Recovery

Key recovery is a critical dependency for encrypted data. Establish supported backup, soft-delete, purge protection, or restoration options as appropriate, and test them before a real outage. Determine which resource operations are affected when a key becomes unavailable and how quickly access can be restored. Ensure operators can recover the key without creating uncontrolled privilege. Confirm that the restored data and application function after recovery.

26. Hands-On Practice and Production Thinking

Create an encryption review sheet for a test storage or database resource. Record default encryption behavior, the need for customer-managed keys, the key owner, permitted identities, rotation process, monitoring, and recovery safeguards. If a lab supports key integration, verify access with the intended service identity and observe behavior when permissions change. Do not disable or delete keys attached to production resources as an experiment.

Related Azure topics include Azure Key Vault: Secrets, Keys and Certificates; Azure Shared Responsibility Model; Microsoft Entra ID and Azure Identity; Azure RBAC; and Azure Security Best Practices. These lessons explain identity, key protection, data responsibility and operational controls.

References and Further Reading

Use current Microsoft Learn documentation to verify service behavior, feature availability, limits, configuration steps, and pricing. The following official references support this article:

  • Azure encryption at rest: https://learn.microsoft.com/en-us/azure/security/fundamentals/encryption-atrest
  • Azure Key Vault overview: https://learn.microsoft.com/en-us/azure/key-vault/general/overview
  • Azure data security guidance: https://learn.microsoft.com/en-us/azure/security/fundamentals/data-encryption-best-practices

Canonical URL: https://kodestree.com/azure-encryption-key-management/