Skip to content
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

Clarify configuration providers for Blazor WASM #18134

Closed
guardrex opened this issue May 4, 2020 — with docs.microsoft.com · 4 comments · Fixed by #19293
Closed

Clarify configuration providers for Blazor WASM #18134

guardrex opened this issue May 4, 2020 — with docs.microsoft.com · 4 comments · Fixed by #19293

Comments

Copy link
Collaborator

guardrex commented May 4, 2020

.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added ⌚ Not Triaged Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue labels May 4, 2020
@guardrex guardrex self-assigned this May 4, 2020
@guardrex guardrex added doc-enhancement Pri2 Priority 2 and removed ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels May 4, 2020
@guardrex guardrex added this to Triage in Blazor.Docs via automation May 4, 2020
@guardrex guardrex moved this from Triage to P2 - Medium Priority in Blazor.Docs May 4, 2020
@guardrex guardrex added this to the 2020 Q2 ends Jun 30 milestone May 4, 2020
@guardrex
Copy link
Collaborator Author

guardrex commented Jul 9, 2020

@captainsafia ... I've looked over the ASP.NET Core Configuration topic to see what we might need to call out that isn't appropriate for Blazor WASM apps. It looks like we should mention that the following aren't appropriate ...

  • Azure Key Vault configuration provider for the managed identity and clientId/clientSecret scenarios. OAuth should work, and I think certificate auth would still be permitted, including with the new Azure.Extensions.AspNetCore.Configuration.Secrets bits. Ordinarily, we wouldn't even mention the clientId/clientSecret approach because our Key Vault config topic totally avoids it. However given that WASM apps are running on the client, it's probably prudent to remind devs never to put any kind of secret or password in a WASM app again here to reinforce the point.
  • Azure App configuration provider
  • Custom config provider based on EF Core

... and we'll include ...

ASP.NET does not require that you can SetBasePath on the ConfigurationBuilder before requesting files via a relative path, so our configuration differs in this way.

... but perhaps writing it out a bit more (with an example perhaps) to make the scenario clear.

@captainsafia
Copy link
Member

Custom config provider based on EF Core

I'm not so sure about this one. @mkArtakMSFT who would be the best person to help us figure out if this is expected to work in Blazor WASM?

@guardrex
Copy link
Collaborator Author

guardrex commented Jul 10, 2020

My concern on that one is WRT the implementation that doesn't meet the guidance for EF Core and Blazor to use OwningComponentBase or DbContextOptions<TContext>. It looks we'd need to call out that the approach can't be used in its present form.

I think this is one that even a Blazor Server app would need a mention on for the same reason.

@guardrex
Copy link
Collaborator Author

guardrex commented Jul 22, 2020

@captainsafia I'm up to working on this one today. I should have the state management doc work done and up in the PR soon, and I should have enough time left today to knock this out (... or tomorrow morning 🏃🏃🏃🏃😅). UPDATE: tomorrow ... ran out of hours today.

I think that I'm right about the EF Core config provider for WASM ... that's not going to work without more work to deal with the concurrent dB context problem.

I see what you mean now. The config provider scenario seems like it may not have a concurrency problem IF the Load method of the provider is only called once at app start. I'll try running a test locally to at least see how that method behaves; but Yes! on asking Artak, Hao, or Jeremy for assistance.

UPDATE ... We might be ok. It looks like Load is only called once at app start to load config using the approach shown. I see some nits to fix with the coverage tho:

  • Namespaces need to be added to the code examples.
  • Adding the config is slightly different (i.e., builder.Configuration.AddEFConfiguration(...);

I think it's probably more important to get this coverage in now before deciding to make an EF Core config provider for WASM. I think I'll open a new issue on hold to collect ideas for future updates where I don't really want to put up in a new issue ... a "nice to have" issue to collect ideas. UPDATE: Done!

@guardrex guardrex moved this from P2 - Medium Priority to In progress in Blazor.Docs Jul 23, 2020
Blazor.Docs automation moved this from In progress to Done Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Blazor.Docs
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants