Skip to content

[Key Vault] Raise useful error when KeyReleasePolicy is incorrectly created #30000

Open
@mccoyp

Description

@mccoyp

The KeyReleasePolicy model expects an encoded_policy parameter as bytes. If a string is passed instead, no error is raised -- but when the created policy is provided to a create_key request, the service returns an error suggesting that the policy was never provided (see #29945):

azure.core.exceptions.HttpResponseError: (BadParameter) AKV.SKR.1004: Exportable keys must have release policy.

This doesn't make the cause of the failure obvious at all. Though input validation is generally avoided, we should raise an error when a string is provided to the KeyReleasePolicy constructor so that users have an easier way to identify the problem.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.KeyVaultMQThis issue is part of a "milestone of quality" initiative.

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions