microsoft / microsoft/aspire

Azure Key Vault AddSecret validation mismatch

Open
#13,285 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
area-integrations
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Adding a secret using `AddSecret` overloads that do not take a ResourceName but only the secret name will fail to deploy due to some valid secret names not being valid resource names.

For example trying to have hierarchical secrets "MySection--MySecret", the problem being the double dash.

### Expected Behavior

Resource name should either be altered to match resource naming rules or at least the affected overloads documentation should be updated to indicate this limitation and point the user to use overloads that do take a ResourceName.

### Steps To Reproduce

```
var builder = DistributedApplication.CreateBuilder(args);
var testParam = builder.AddParameter("TestParam", true);

keyVault = builder.AddAzureKeyVault("key-vault");
keyVault.AddSecret("MySection--MySecret", testParam);
```

### Exceptions (if any)

_No response_

### .NET Version info

10.0.0

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.