-
Ok so we are moving existing applications to use Aspire. The next step is to pull in secrets from Azure Key Vault as per the documentation we are doing this using the code below var builder = DistributedApplication.CreateBuilder(args);
var existingKeyVaultName = builder.AddParameter("key-vault-name",value: "my-key-vault");
var existingKeyVaultResourceGroup = builder.AddParameter("rg-name", value: "my-resource-group");
var keyvault = builder.AddAzureKeyVault("my-keyvault")
.AsExisting(existingKeyVaultName, existingKeyVaultResourceGroup);
var dataBentoApiKey = keyvault.GetSecret("MySecret");` Then supplying the Azure config in the appsettings.json like below. "Azure": {
"ResourceGroup": "my-resource-group",
"SubscriptionId": "MySubId",
"AllowResourceGroupCreation": false,
"Location": "UK South"
} When I Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found the issue, It had stored some incorrect secrets previously where the Resource group was not set, once I cleared these secrets and ran again it all worked as expected |
Beta Was this translation helpful? Give feedback.
Found the issue, It had stored some incorrect secrets previously where the Resource group was not set, once I cleared these secrets and ran again it all worked as expected