-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new module for OrchardCore.KeyVault.Azure #6422
Add new module for OrchardCore.KeyVault.Azure #6422
Conversation
If this looks good, I would be happy to add some further documentation on how to use |
Looks great, will take a closer look tomorrow if @jtkech doesn't tonight
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
src/OrchardCore/OrchardCore.KeyVault.Azure/Extensions/AzureKeyVaultWebHostBuilderExtension.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.KeyVault.Azure/OrchardCore.KeyVault.Azure.csproj
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.KeyVault.Azure/Services/CustomKeyVaultSecretManager.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.KeyVault.Azure/Services/CustomKeyVaultSecretManager.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.KeyVault.Azure/Services/CustomKeyVaultSecretManager.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.KeyVault.Azure/Services/CustomKeyVaultSecretManager.cs
Outdated
Show resolved
Hide resolved
ee6030f
to
584b72b
Compare
Thanks @jtkech. Made all above requested changes and added the documentation. |
@JoshLefebvre perfect i approved it Just one last thing, maybe not the right place for the readme as |
Looks good @JoshLefebvre I fixed a couple of typos in the docs. Can you move it to the core section as @jtkech suggested, and also it needs an entry in the |
Is it ready to merge? |
src/OrchardCore/OrchardCore.KeyVault.Azure/Extensions/AzureKeyVaultWebHostBuilderExtension.cs
Outdated
Show resolved
Hide resolved
Output: "OrchardCore:OrchardCore_Shells_Database:ConnectionString". | ||
See https://github.com/OrchardCMS/OrchardCore/issues/6359. | ||
|
||
## Configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a small example that uses directly AzureKeyVaultSecretManager
such that standard ASP.NET tutorials can be followrd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean an example of IConfiguration? I have been using it to retrieve my media and database connection strings. For example in DatabaseShellConfigurationSources.cs:
Using the following Keys:
OrchardCore--OrchardCore---Shells---Database--ConnectionString
OrchardCore--OrchardCore---Shells---Database--DatabaseProvider (Not actually a secret, but required to get the section)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Seb was asking for is something that matches the getting started guides from the ASP.NET docs here https://docs.microsoft.com/en-us/aspnet/core/security/key-vault-configuration?view=aspnetcore-3.1
Where they are using the AzureServiceTokenProvider
callbacks and such.
Which makes me also wonder if we should not be using the callback technique, rather than having our own configuration secrets for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here @JoshLefebvre just override the DefaultKeyVaultSecretManager
with a new AzureKeyVaultSecretManager
and provide an AddOrchardCoreAzureKeyVault()
extension that uses it and other config values.
But people can just follow the aspnet documentation and then use new AzureKeyVaultSecretManager()
in place of new DefaultKeyVaultSecretManager()
So maybe just remove the AddOrchardCoreAzureKeyVault()
that is just an example on how to use the new AzureKeyVaultSecretManager
and let people follow the doc and do their own extension if they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand your implementation right that you have added replacement of ---
to _
along with default --
to :
behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xperiandri Exactly, this is what @JoshLefebvre did ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that something that is common? Either in OC or ASP.NET with Keyvault?
Cool, so is only getting started guide left? |
Please resolve conflict. |
The preferred way of communicating with the Azure Keyvault for a web app is through Managed identity rather then a service principal with a object id and password. Can we make sure that that scenario is also supported? I can work on this if you like |
@MarcBruins I think that ultimately we should have an external OC Management tool that could be deployed as an Azure Function that would allow to configure all things related with the Azure Portal services. Here, what I don't like is the fact that OC configures it's own Azure Services. This can easily lead to security issues. Also, I think that it could be a good way to start experiment things with the new Azure SDK. |
Can you please fix the conflicts @JoshLefebvre? |
@agriffard yes sorry for the hiatus. I have a lot more free time now and hope to actively start contributing to this project again. I will try to get this done today |
4a975dd
to
f025cdf
Compare
f025cdf
to
837691f
Compare
69d8b99
to
8538dc3
Compare
@deanmarcussen @agriffard so I've updated the Key Vault package to make use of the new Azure SDK package Azure.Extensions.AspNetCore.Configuration.Secrets to connect to keyvault. I have also added the Azure.Identity package which is now the recommended way to authenticate with Azure resources via Active Directory token authentication and should resolve the issues people were mentioning above . Azure Identity supports:
|
Can you please review it @deanmarcussen ? |
Great, thanks for updating this @JoshLefebvre - they've definitely improved the libraries a lot since moving to the new Azure packages. Couple of thoughts, and I will bring @jtkech in here as well, as he may agree / disagree Because this is a program level configuration, I don't think it should be using the I'm also thinking it's not a module. Because we can't load it modularly, for the same reasons. Which makes it more like the Shells.Azure configuration, which we did as a seperate nuget package, as part of the Lastly we need to pick a name. Because it's KeyVault Configuration - rather than KeyVault itself, which would have a read/write option, and we might be using it for read / write (i.e. it'd be good to do a Azure have called it Would |
@deanmarcussen okay i will take a look on it this night |
Yes i agree, didn't see it was under the Then yes, good to have custom config / settings sources for all tenants and tenant specific, as we did from blob and database, but yes in a separate PR. So we already have Meanwhile for this PR, idem here i would suggest |
Please merge dev and solve appsettings.json conflict. |
@JoshLefebvre sounds like @jtkech and I agree on the name, and to move it out of modules.
I withdraw my comment here, we already hosted the shells settings under So just to move the folder, and rename thank you |
I agree |
Thanks @jtkech and @deanmarcussen. Yes agreed, makes much more sense in the OrchardCore module now that you explain it. I've also updated the name to OrchardCore.Configuration.KeyVault as suggested :) |
fbef147
to
56abadf
Compare
Build retry |
LGTM |
Thank you. 163rd project in the solution. |
Based on conversations had in #6359