Azure Key Vault Encrypt with AES returns 413 Request Entity Too Large

Bobby Bridges 0 Reputation points
2025-02-04T18:25:25.89+00:00

I'm using a 256 bit AES key that's stored in Azure Managed HSM and I'm trying to encrypt data using the Azure SDK. When I try to encrypt the data using the AES key, the SDK returns a 413 Request Entity Too Large error. The data is likely in JSON format and I'm using Encoding.UTF8.GetBytes prior to making the Encrypt call with the SDK. Do you have any suggestions to avoid this error?

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,368 questions
Azure Dedicated HSM
Azure Dedicated HSM
An Azure service that provides hardware security module management.
34 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.