question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a SecretStorageProvider for Key Vault that uses Azure.Identity

See original GitHub issue

What problem would the feature you’re requesting solve? Please describe.

The existing Key Vault provider makes use of a library that is considered deprecated.

Describe the solution you’d like

Azure.Identity is the better choice for a dependency here, and it allows us to collapse the configuration, relying just on a single connection name. Microsoft.Extensions.Azure might be the best way to bring this in. This aligns with general design for referencing identities. User-assigned support is notable as still TBD from a configuration perspective, but should be handled by that connection abstraction.

Note that this must be a new provider within the host 3.0 context, as it would be a breaking change against the existing provider. In a future major version, the existing provider could be dropped in favor of this one.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattchendersoncommented, Sep 16, 2021

Relevant area: https://github.com/Azure/azure-functions-host/blob/08269604939797bf30b52c4dcb7077a2d57fc87b/src/WebJobs.Script.WebHost/Security/KeyManagement/KeyVaultSecretsRepository.cs

Uses: using Microsoft.Azure.KeyVault.Models; using Microsoft.Azure.Services.AppAuthentication; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Clients.ActiveDirectory;

Desired instead:

Migration guide: https://docs.microsoft.com/en-us/dotnet/api/overview/azure/app-auth-migration

I note that the provider does in fact have a connectionString parameter which I think we mapped to a setting somewhere although it wasn’t doc’d. But those environment variables would need to be different now: https://github.com/Azure/azure-functions-host/blob/08269604939797bf30b52c4dcb7077a2d57fc87b/src/WebJobs.Script.WebHost/Security/KeyManagement/DefaultSecretManagerProvider.cs#L72-L73

Other components in the system make use of https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/extensions/Microsoft.Extensions.Azure as an abstraction. This has a number of benefits, including using DefaultAzureCredential unless config is provided for a user-assigned identity. That makes use of a different config format though which may be a better replacement.

0reactions
liliankasemcommented, Sep 30, 2021

Closing as #7683 merged, @mattchenderson feel free to reopen if I missed anything

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Use a managed identity to access Azure Key Vault ...
Navigate to your newly created Key Vault. · Select Secrets, and select Add. · Select Generate/Import · In the Create a secret screen,...
Read more >
Provide access to Key Vault keys, certificates, and secrets ...
Go to Key Vault > Access control (IAM) tab · Select Add > Add role assignment to open the Add role assignment page....
Read more >
Store credentials in Azure Key Vault - Data Factory
Learn how to store credentials for data stores used in an Azure key vault that Azure Data Factory can automatically retrieve at runtime....
Read more >
Use the Azure Key Vault Provider for Secrets Store CSI ...
The add-on creates a user-assigned managed identity, azureKeyvaultSecretsProvider , to access Azure resources. The following example uses this ...
Read more >
Use Azure Key Vault secrets in Azure Pipelines
Navigate to Azure portal. · Use the search bar to search for the key vault you created earlier. · Under Settings Select Access...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found