Came back for a refresher. A great summary, thanks! One thing I still ponder about is nullability on classes and records that are loading, e.g. config from disk etc., where you want to almost tell the compiler, “these fields are always set”. I guess this is adding ! to members but maybe there is a better way?
great tutorial. I must have missed something though as even when I log in and get the token, pass it to the web api I am getting a 401 error. I've gone over the code and tutorial and I'm not seeing my mistake. Any "usual suspects" for this issue? I am able to display my name once logged, it's just the call to the weatherforecast that is denied. truly appreciate any ideas.
Are you sure you have the middleware in the server app correctly setup with the same client/tenant ids and client secret? Are you sure you're setting the auth header correctly? Those are two places I'd start
@@swildermuth thanks so much for the reply, I'm not quite sure what you mean by client secret. I've checked the clientid/tenantid, authority, scopes and the "bearer " + token... all look good. I'll keep looking :)
If you go to your App Registration for your app and look at "Manage->Certificates and Secrets" - you'll need to create a new secret and pass it into the options.ClientSecret where you set the clientid and the tenant id.
is there a way to make these settings region independent? configuration is definitely one of issues when you have so many azure app services and function apps but the other issue I see is also creating one function app for each region. Ideally Microsoft should have setting when you create an app service or function app it should ask if you want regional redundancy (and then let you pick which region, ) just like zone redundancy and then it should automatically give you the new url which is created with front gate and application gateway preconfigured /predeployed vs us having to create one in say East region one in West region. Are there other cloud providers that offer this kind of region redundancy by default as part of code deployment? is this something planned for future or maybe its out there and I am not aware.
I don't know. But if it doesn't support it, you could use a prefix (e.g. ASIA:...) to have region specific. I think it only georeps the whole one. Also, these are cheap, so you could just have one for each region.
Hi shawn , great example. Got confused in one place where you have configured app config connection in app settings file this is fine for local but when we deploy application from where we read this connection string.
It's just a configuration setting, so as an Environment Variable is usually how it is done (this is the one bootstrapping config that you need to read the rest of the app configuration)
This seems great for a production setup. For local dev would you just wrap the .Add with #if RELEASE or would you recreate all the keys in the Azure App Configuration with a Dev label and dev values, but then how would other devs have different settings?
I would use appsettings.{buildtype}.json for dev-time configuration. I wouldn't even apply the App Configuration at dev time. For secrets, User Secrets. In .NET Core, I would never do #if RELEASE as Environment.IsDevelopment() is preferred.
It is like asking: Can you mom do better than this, well for sure but here we are 🤣🤣 (the wisdom in this is that we already have it, we already use it no worry to work more to improve it)
Great content as usual! Thanks Shawn! I performed some modifications in the "Configure Code Cleanup" settings and I wish all of these settings were applied to all projects in the solution. But, it seems these settings are Visual Studio specific because I do not see any changes in .editorconfig or any other file I can transport with the code to have solution-specific settings.
I just discovered your channel now and I don't know what it is, but you are great at explaining things without dumbing it down. You take us through your thought process and it is evident you have a very lucid understanding of the subject matter edit: its too bad that the FluentValidation.AspNetCore package is no longer being maintained. Perhaps a follow-up video using the standard FluentValidation package would be helpful. :)
OneOf<GeneralFailResponse, IReadOnlyList<Customer>> custResult = GetCustomers(); or var custResult = GetCustomers(); I choose to hover with my mouse for this one.
I honestly like swagger UI as-is. Grouping, Auth configuration, versioning, layout, try-me-out etc just with a few lines of code. It's snappy and works great for devs.
I don't think you have to give it up, they're just not requiring this implementation and allowing themselves to keep up with the latest versions of OpenAPI separate.
Microsoft is really dropping the ball up and not producing a UI solution that consumes the open api's Package generates. I like the idea that it's extensible and that the community can write other different friends of the Jews to, but we shouldn't be reliant on that for a solution. Microsoft should offer a default UI experience and if we don't like that we can swap it out for a community alternative
I like the more compact UI, but what I am not seeing, and can't see when looking at the documentation is how authentication is handled. SwaggerUI has configuration to configure your authentication mechanism, which for us is an OpenID Connect integration with our federated auth service. Swagger UI presents you with an "Authorize" button, which when clicked presents you with a modal form to kick off the auth process. I'm not seeing that mentioned in the Elements WebComponent documentation. I guess we could use the Angular or React route and build in an authorization path. But SwaggerUI gives us this level of configuration out of the box. Looking at the Issues on the Elements github, it looks like there is Authorization in some form, as I can see Issues with basic auth not working as some people expected. So maybe some more digging required on my part to understand how the OpenId Connect auth can be integrated.
Hi Shawn, I would like to learn more about it like how did you manage this on production? Were both sites deployed, or the new site was deployed after the migration process was done completely? What about third-party components? Did you face any challenge during migration?
This is the only video I needed. I have been stuck on how should I make my web app offline and found this guy explaining pwa in very simple terms. Thank you sir, it was a very informational video
Really useful tutorial, nice work! Tried it out and it works like a charm. Also, tried importing bootstrap and font-awesome into the custom element but they don’t seem to work correctly. Any idea what could be the issue?
That was like a super-concentrated C# learning syrup. Brilliant! Not sure I'll ever use records, but it's great to at least understand what they're for as I'm sure a use-case will pop up at some point. Great work - thank you!