Azure / Azure/api-management-policy-snippets
Certificate retrieved from KeyVault Error
- Dominant language
- No language data
- Stars
- 399
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
I am working in setting an inbound policy to read the certificate from Key Vault and forward it to the backend under API Management.
When I upload the certificate in APIM itself and use the below line with thumbprint I am able to get a valid response,
```csharp
```
When I upload the same certificate in Key Vault and add my policy accordingly. I am able to read the certificate body but when passing it to backed I get the error as per APIM trace "**Certificate does not have private key**". Below is my APIM policy code for reference :
```csharp
https://testcertvault.vault.azure.net/certificates/TestCertificate/import?api-version=7.1
GET
()["cer"].ToString())" />
```
I get the same error in track if I update the `` value
```csharp
https://coloclientcert.vault.azure.net/secrets/ColoCertificate/?api-version=7.1
```
Any idea what I am missing.
Contributor guide
No contributing guide indexed for this repository
Research direction
Review the authentication-certificate policy and the Key Vault certificate and secret endpoints shown in the issue, starting with the APIM trace error. Confirm whether the retrieval path preserves a private key and document the required correction or limitation; no repository file or test is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100