This is very detailed and I solved a huge problem I was facing with certificates. That simple point you mentioned about .pfx file name matching the library was the magic key!
This was exactly what I needed to get a job done. You explain things really well, and although some people might get frustrated with you for going over things, it really helped me fill in some knowledge gaps. Thanks again!
This is gold! I love the way you purposely show issues other will encounter rather than, and help them fundamentally understand what is going on, instead of just going through it the correct way first time around.
Thanks mate! Sometimes I think I over-explain, but I do like to point out areas where you could get tripped up, (because I do!). I actually think those areas are the parts where you learn the most anyway, so I'm glad you find the approach useful. Thanks for the feedback, really appreciate it! Les
I wish I would have found this video this morning because it would have saved me an entire day of swearing and reading a lot of things that might have worked in the past but don't anymore. Either way, thanks a lot!
Your video's are great: not too slow, not too fast. Sound and image quality is good. All necessary details are mentioned. Really useful information, that I can apply in my projects.
Just sharing what I learnt yesterday. You can simply scaffold Dockerfile from Command Palette by pressing Ctrl + Shift + P and look for "Add Dockerfile" (after Docker extension installed). This will prompt and auto-generate Dockerfile into your project
thanks for such a wonderful video. I left your microservice video to come here and learn a bit more about docker (I felt like I was lacking some well needed info). I'm going back to continue. thank you for been a good teacher
Wow, I am waiting for this type of lecture since long back. No time to do analysis and learn on my own. You became my God while in this Pandemic, not just because of this single video, but due to multiple Diamond like videos.
Darn, just watched this after spending the day getting this implemented at work. Nice one. P.S. there is another environment variable for kestrel that allows you to specify the certificate name so that it doesn’t have to be named the same as the dll. Useful if you have multiple services using the same certificate (e.g. a wildcard one from a trusted CA).
Not sure if there are any specific resources that cover this. But if you check out docs.microsoft.com/en-us/dotnet/core/additional-tools/self-signed-certificates-guide you will see that a path is specified for the certificate in the docker commands. Based on that you can define either an environment variable or specify the location in your app settings or secrets files.
Great job Les! Thanks a lot for the great tutorial. Would have been great if you could have also explained what changes when deploying release image in production, but even ASIS this is a tutorial of a great value. Thanks again!
This is an excellent, well explained tutorial. One thing that I'm wondering though- what are the steps to HTTPS secure such containers in production? And also- how to do it when having 2 ASP Core APIs, each in its own container, and you want them to talk to each other over HTTPS?
Best video for this content I found on YT, I hope there is next video how we can hope this docker image on Kubernetes with HTTPS enabled, I tried to search it but not found it. @binarythistle please do create content video for this.
Good base explanation and POC, but some areas that could use more info on: * connecting to a db while using https (assuming secrets from azure or aws would be easiest for prod quality connection credentials) * setting it up with nginx and certbot/lets encrypt * doing this all at production quality. pet peeve of tutorials is *it's fine here, but don't do it in prod* that's not very useful for me 🤷🏼♂️
Thank you so much Les, much appreciated. I also noted that the docker file name must be "Dockerfile" otherwise the docker-compose file will complain and wont build the image.
Great work Les. Would be great to see how you would be able to use different sql connection strings in different environments. If you know where I could find this info that would also be great, thanks.
You lost me a bit in the intro with the self signed certificate. Do you ultimately end up showing how to use a domain friendly cert from something like Let’s Encrypt? Ultimately one would need to be able to deploy to production.
If youre getting this error; Specify which project or solution file to use because this folder contains more than one project or solution file. Add .csproj RUN dotnet publish .csproj -c Release -o out Instead of RUN dotnet publish -c Release -o out
Fantastic content Les. You can hear the passion and commitment you have to the topic in all of your videos. Love listening, and working through them. I am a full stack consultant/developer but haven't really lived in the MS world at all. At 11:40 or so into the video you mention a command: code -r WeatherAPI which fails to work on my mac, after I had just installed the free version of vscode. Just a heads up that it might be something to mention to non-MS/vscode users out there. Thanks again for sharing you experience.
Hi, I'm following this tutorial but whatever I do I still have this error, "System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date." any solution?
@@binarythistlenice to hear that your safe and well too, I hope everything is going to be ok in Melbourne. I m fine, Switzerland have ended the lock down we are doing fine here, I m still working from home and your videos are still very helpful :) thank you a lot. Stay safe
Thank you for this wonderful post. we would also like to see how this would work when we host it from linux container or linux machine. Love to know what are all the stuffs needs to be done in addition for Linux specially for making it a HTTPS.
Hi Les Jackson, would you be able to do a video using let’s encrypt. I think you have the best videos online on this topic. If you know any existing videos to use let’s encrypt and deploy https container to azure, could you reply with the link to me please. Thanks 😊
Excellent explanation Les. I have similar requirements, how to I add 15 root certificates to a .NET Core 6.0 application Docker container ?. I used the command "RUN powershell Import-Certificate -FilePath C:\certs\myroot.cer -CertStoreLocation Cert:\LocalMachine\Root" my application did not recognize the certs. Can you please help ?.
For production, it is necessary to have the user secrets ?, or it would be enough to just specify the certificate path and password ?. I'm not sure how to do it.
This is still working up to this day. However: In a docker compose file if i use the Kestrel Certificate Default Path and password it wont work. Why is that ?
Thank you very much for this video, well explained and you helped me fix my issue . Which was the case sensitivity of the certificate and also that it needs to have the same name as the entrypoint dll name.
Thank you for the amazing tutorial, but I have one issue which is the app can not read that secret.json to get the certificate password instead I just provide the kestrel password in the environment variables directly in compose file, can you suggest a better solution for that. ps: i successfully map the user secrets folder inside the container and check it using bash command. Thank you
Great walkthrough! I follow the same but I didn't manage to put it to work without setting the variables ASPNETCORE_Kestrel__Certificates__Default__Password and ASPNETCORE_Kestrel__Certificates__Default__Path. Any guess why?
I am not able to run the container (docker run weatherapi). It returns a weird error: "It was not possible to find any installed .NET Core SDKs". Any suggestions? Thanks!
I had a issue in Dockerfile file, I had FROM mcr.microsoft.com/dotnet/aspnet:3.1 , but an error was not letting me pass, so I changed for this line: FROM mcr.microsoft.com/dotnet/aspnet:5.0 and It works.
Hi, Les! Thank you for this amazing video, surely helped me a lot. However, I have some questions about it. Is it possible to commit the certificate on Github so anyone who forks the project doesn't have to configure the certificate themselves? Is it possible to make this out of the box with docker? Cheers!
Thanks for the video! Can someone help me out applying this to a microservice architecture? Each service is happy to run in HTTPS, but breaks when it comes to communicating with each other. I think there is also an issue with docker-compose and how the DNS uses the image name as apposed to localhost.
Hi, Good video. i'm doing a image .net Core 3.1 for Debian 9 stretch. But I have error to image sdk version and image runtime version they aren't compatible. Only can I use .Net Core 2.1 for Debian 9 -stretch ?.
Thanks for sharing. One more thing I want to add like can we have one demo for api gateway and multiple microservices with docker compose and how we can deployed in azure... if possible can you create video for that...
It would be much appreciated if you could create a playlist with best practices and maybe some libraries you often use in daily work. (Mid-senior level would be best appreciated)
@Les Jackson #Les Jackson Hi, I was wondering if there is a way to utilize Typescript with dotnet core 3.1 and web api? I would really love to see the use of Typescript in the backend on dotnet core.
normally I don't commented on any of this, but this video was very helpful, do you have any advice on put this into production or its the same configuration?
Hi Les, First, you are doing a great job on your videos, thanks for sharing. I have a question about running docker. I am using Visual Studio and added support for docker. When I run F5, it builds and loads the image in Docker Desktop. I am then able to navigate to the swagger document without an issue, but when I stop the debugger, I can no longer navigate to the swagger document even though the Docker Desktop shows the image is still running. Any Ideas? The second part is if I switch over to VS Code and go to the solution folder and try to manually build the image (I include -f [folder]\Dockerfile, the build process errors out with failed to compute cache key: I did change the . to the project folder
did anyone run into this issue --> crit: Microsoft.AspNetCore.Server.Kestrel[0] Unable to start Kestrel. System.InvalidOperationException: Unable to configure HTTPS endpoint. during docker run command
Have you had any experience with trying to get the ASP.NET Core 3.1 servers (in docker containers) to talk to *not just the host* but also with *each other* over https... I am hitting an issue where the backend servers cannot talk to each other (even when I put them all in the same container --- says: The SSL connection could not be established, see inner exception. Authentication failed because the remote party has closed the transport stream. From the host side I can view the website via https but when the backend requests from another backend server the SSL error rears its head... - Seems like maybe it must be to do with the underlying linux distro's root CAs then? Otherwise why would the same code + certificate work on windows but not inside docker (I followed this video and so the User Secrets and .pfx is all there...). (I am using linux containers on windows).
This is very detailed and I solved a huge problem I was facing with certificates. That simple point you mentioned about .pfx file name matching the library was the magic key!
This was exactly what I needed to get a job done. You explain things really well, and although some people might get frustrated with you for going over things, it really helped me fill in some knowledge gaps. Thanks again!
This is gold! I love the way you purposely show issues other will encounter rather than, and help them fundamentally understand what is going on, instead of just going through it the correct way first time around.
Thanks mate! Sometimes I think I over-explain, but I do like to point out areas where you could get tripped up, (because I do!). I actually think those areas are the parts where you learn the most anyway, so I'm glad you find the approach useful.
Thanks for the feedback, really appreciate it!
Les
I wish I would have found this video this morning because it would have saved me an entire day of swearing and reading a lot of things that might have worked in the past but don't anymore. Either way, thanks a lot!
This is absolutely awesome. Helped me get out of a week long block in my project. Thank you so much.
Video speed and amount of detail is spot on too.
I struggled with this until I watched this video. Great work and very clearly expalined.
the way you explain things is excellent! your video helped me a lot, thank you! Greetings from Argentina.
Your video's are great: not too slow, not too fast. Sound and image quality is good. All necessary details are mentioned. Really useful information, that I can apply in my projects.
Les, you are awesome!! I like all of your videos, you definitely deserve way more subs !
Just sharing what I learnt yesterday. You can simply scaffold Dockerfile from Command Palette by pressing Ctrl + Shift + P and look for "Add Dockerfile" (after Docker extension installed). This will prompt and auto-generate Dockerfile into your project
Do you have a Production Environment Version of this tutorial? Still really good work on explaining how this works!
Did you ever find anything covering this? I need it desperately, my searches aren't turning up with much.
thanks for such a wonderful video. I left your microservice video to come here and learn a bit more about docker (I felt like I was lacking some well needed info). I'm going back to continue. thank you for been a good teacher
Les Jackson's channel is probably the best Learning Platform!! Thank you for all the awesome work
Wow! Thanks Abdul - that's really kind of you to say! Cheers Les
Wow, I am waiting for this type of lecture since long back. No time to do analysis and learn on my own. You became my God while in this Pandemic, not just because of this single video, but due to multiple Diamond like videos.
Hi Ashok - thank you my friend for those lovely words - I really appreciate it! Glad you're enjoying the videos, take care, Les
Les I cant thank you enough for your tutorials. I always find solutions to my problems from your videos. Big Thanks
Wow finally the wait is over :)
:)
Thanks Jackson for your effort. You are the spider man of the dotnet.
Thanks Prasanth!
Thank you very much, especially at the time of the video 15:17.
Darn, just watched this after spending the day getting this implemented at work. Nice one. P.S. there is another environment variable for kestrel that allows you to specify the certificate name so that it doesn’t have to be named the same as the dll. Useful if you have multiple services using the same certificate (e.g. a wildcard one from a trusted CA).
Link to resource please
Not sure if there are any specific resources that cover this. But if you check out docs.microsoft.com/en-us/dotnet/core/additional-tools/self-signed-certificates-guide you will see that a path is specified for the certificate in the docker commands. Based on that you can define either an environment variable or specify the location in your app settings or secrets files.
@@whatizzydoin Thank you
Great job Les! Thanks a lot for the great tutorial. Would have been great if you could have also explained what changes when deploying release image in production, but even ASIS this is a tutorial of a great value. Thanks again!
Really appreciate the clarity and completeness of the content. 👍👍 Very practical and just what I needed!! Thanks
Thanks a lot for this video.You've excellently explained the https mechanism for asp.net core.
Thanks. Fantastic job! Note: Amazon says you have 5 reviews on your book (average 4/5). But they only display the review by the guy who gave it a 2.
Awsome explanation, awsome detailed, awsome clarification, awsome to find you to explain this :D
i Absolute love this.... you help me a lot...
This is an excellent, well explained tutorial. One thing that I'm wondering though- what are the steps to HTTPS secure such containers in production? And also- how to do it when having 2 ASP Core APIs, each in its own container, and you want them to talk to each other over HTTPS?
Best video for this content I found on YT, I hope there is next video how we can hope this docker image on Kubernetes with HTTPS enabled, I tried to search it but not found it.
@binarythistle please do create content video for this.
Amazing in details dive inside docker..thank you so much
This helped me immensely!! And was exactly the explanation I was looking for thanks. Will defiantly be watching more of your videos. Thanks
Excellent lecture :) Congrats, Les!
Thanks Cristiano!
Awesome tutorial, thanks a lot ! :)
Good base explanation and POC, but some areas that could use more info on:
* connecting to a db while using https (assuming secrets from azure or aws would be easiest for prod quality connection credentials)
* setting it up with nginx and certbot/lets encrypt
* doing this all at production quality. pet peeve of tutorials is *it's fine here, but don't do it in prod* that's not very useful for me 🤷🏼♂️
Excellent tutorial! Particularly happy to see you do it through VS code and will try to replicate this on a Mac!
Yeah, this is great that Les used VS Code.
Thank you so much Les, much appreciated.
I also noted that the docker file name must be "Dockerfile" otherwise the docker-compose file will complain and wont build the image.
No dislakes. This is the most powerfull measure.
You are the best! Hey people He is the best i have ever met! Thank you :)
Amazing tutorial! Your content is simply superb. Keep up with the good work!
Great work Les. Would be great to see how you would be able to use different sql connection strings in different environments. If you know where I could find this info that would also be great, thanks.
Les , you are star mate !!
Absolutely amazing tutorial.
Many thanks, very useful and easy steps otherwise would be painful. All the best..
thanks bro for awesome explanation, very clear and easy to understand
You lost me a bit in the intro with the self signed certificate. Do you ultimately end up showing how to use a domain friendly cert from something like Let’s Encrypt? Ultimately one would need to be able to deploy to production.
If youre getting this error;
Specify which project or solution file to use because this folder contains more than one project or solution file.
Add .csproj
RUN dotnet publish .csproj -c Release -o out
Instead of
RUN dotnet publish -c Release -o out
xcellent tutorial, thanks a lot for clear instructions.
your videos are a life saver! keep it up.
I must echo the messages below, as always outstanding content and very helpful. GOD bless you my friend.
Thanks mate, best wishes to you too from Melbourne!
Thanks for a great video, very clear and selection of level of detail.
The best Channel, thanks
Wow, thanks!
Incredible guide! Thanks!
Yesterday I learned about the docker and today you bring this video :) thanks a lot Les 🎉🎉
Hope you enjoyed it!
Thanks for making this video!
Thank you so much, this helped a ton!
thanks Jackson, This is an amazing sharing and super helpful for me and the details are very fantastic
Wow!!!! Thank you. You are a good instructor❤❤❤😊
Fantastic content Les. You can hear the passion and commitment you have to the topic in all of your videos. Love listening, and working through them. I am a full stack consultant/developer but haven't really lived in the MS world at all. At 11:40 or so into the video you mention a command:
code -r WeatherAPI
which fails to work on my mac, after I had just installed the free version of vscode. Just a heads up that it might be something to mention to non-MS/vscode users out there.
Thanks again for sharing you experience.
I'm pretty late to the party, but to open a directory in code on Mac you can do code or if you're in the folder do code . to ref the current folder.
Hi, I'm following this tutorial but whatever I do I still have this error, "System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer
certificate could not be found or is out of date." any solution?
Maybe because the password set for the certificate does not match your password in the secrets
did you solve it?
for me it was permission problem "--user root" in terminal command fixed that
Than you so much an excellent, well explained tutorial 😊
Thank you for the video sensei. Greating from Switzerland
Hey Maxime! Nice to hear from you again! Hope you're safe and well in Switzerland!
Locked down here in Melbourne, but we're all good!
Stay safe,
Les
@@binarythistlenice to hear that your safe and well too, I hope everything is going to be ok in Melbourne.
I m fine, Switzerland have ended the lock down we are doing fine here, I m still working from home and your videos are still very helpful :) thank you a lot.
Stay safe
Please create a video on microservice using gRpc and .net core + docker
That is cool, thank you very much! Do you want to make a video about Redis or Memcached with .NET ?
Excellent tutorial, thanks a lot for clear instructions.
Thank you for this wonderful post. we would also like to see how this would work when we host it from linux container or linux machine. Love to know what are all the stuffs needs to be done in addition for Linux specially for making it a HTTPS.
Hi Les Jackson, would you be able to do a video using let’s encrypt. I think you have the best videos online on this topic. If you know any existing videos to use let’s encrypt and deploy https container to azure, could you reply with the link to me please. Thanks 😊
Excellent explanation Les. I have similar requirements, how to I add 15 root certificates to a .NET Core 6.0 application Docker container ?. I used the command "RUN powershell Import-Certificate -FilePath C:\certs\myroot.cer -CertStoreLocation Cert:\LocalMachine\Root" my application did not recognize the certs. Can you please help ?.
Thank you for the great content I learn a alot from your videos you are great
Thanks Jackson, it's very useful for me. How to use SSL certificate docker container in AWS EC2
For production, it is necessary to have the user secrets ?, or it would be enough to just specify the certificate path and password ?. I'm not sure how to do it.
Thank you Les!
Hi Les, Thanks for nice video.. Do you have any suggstion to deploy docker image to azure ?
This is still working up to this day.
However:
In a docker compose file if i use the Kestrel Certificate Default Path and password it wont work. Why is that ?
Thanks man, this really helped me
Thank you very much for this video, well explained and you helped me fix my issue .
Which was the case sensitivity of the certificate and also that it needs to have the same name as the entrypoint dll name.
Thanks for that - you helped me a lot.
Superb content !
You have done a great job here. May I know will you be making the the same thing using .net 5?
Hi. Can you teach us how we can deploy https in production? Thank you
good job done, but do you have any info on how to host .net core web api in windows service with https scheme
thanks you for helping us.
Thank you for the amazing tutorial, but I have one issue which is the app can not read that secret.json to get the certificate password instead I just provide the kestrel password in the environment variables directly in compose file, can you suggest a better solution for that.
ps: i successfully map the user secrets folder inside the container and check it using bash command.
Thank you
Wouldn't mind a video explaining how to set up Docker in WSL. I have tried and definitely run into issues.
Great walkthrough! I follow the same but I didn't manage to put it to work without setting the variables ASPNETCORE_Kestrel__Certificates__Default__Password and
ASPNETCORE_Kestrel__Certificates__Default__Path. Any guess why?
Maybe because the password set for the certificate does not match your password in the secrets
have you done without that?
I am not able to run the container (docker run weatherapi). It returns a weird error: "It was not possible to find any installed .NET Core SDKs". Any suggestions? Thanks!
This helped a lot.
Great job 🙂
I had a issue in Dockerfile file, I had FROM mcr.microsoft.com/dotnet/aspnet:3.1 , but an error was not letting me pass, so I changed for this line: FROM mcr.microsoft.com/dotnet/aspnet:5.0
and It works.
Hi, Les! Thank you for this amazing video, surely helped me a lot. However, I have some questions about it. Is it possible to commit the certificate on Github so anyone who forks the project doesn't have to configure the certificate themselves? Is it possible to make this out of the box with docker? Cheers!
This is a great video!
you are genius.. saved my day!!.. :)
Thanks for the video!
Can someone help me out applying this to a microservice architecture? Each service is happy to run in HTTPS, but breaks when it comes to communicating with each other. I think there is also an issue with docker-compose and how the DNS uses the image name as apposed to localhost.
Hi, Good video. i'm doing a image .net Core 3.1 for Debian 9 stretch. But I have error to image sdk version and image runtime version they aren't compatible. Only can I use .Net Core 2.1 for Debian 9 -stretch ?.
Thanks for sharing. One more thing I want to add like can we have one demo for api gateway and multiple microservices with docker compose and how we can deployed in azure... if possible can you create video for that...
Dear sir, great content.
It would be much appreciated if you could create a playlist with best practices and maybe some libraries you often use in daily work. (Mid-senior level would be best appreciated)
@Les Jackson
#Les Jackson
Hi, I was wondering if there is a way to utilize Typescript with dotnet core 3.1 and web api? I would really love to see the use of Typescript in the backend on dotnet core.
normally I don't commented on any of this, but this video was very helpful, do you have any advice on put this into production or its the same configuration?
Great video!
Hi Les, First, you are doing a great job on your videos, thanks for sharing. I have a question about running docker. I am using Visual Studio and added support for docker. When I run F5, it builds and loads the image in Docker Desktop. I am then able to navigate to the swagger document without an issue, but when I stop the debugger, I can no longer navigate to the swagger document even though the Docker Desktop shows the image is still running. Any Ideas? The second part is if I switch over to VS Code and go to the solution folder and try to manually build the image (I include -f [folder]\Dockerfile, the build process errors out with failed to compute cache key: I did change the . to the project folder
Thank you so much, very helpful.
This is really awesome thanks for this video, can you please make a video on handling the concurrency issues in web api core.
did anyone run into this issue --> crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.InvalidOperationException: Unable to configure HTTPS endpoint. during docker run command
Have you had any experience with trying to get the ASP.NET Core 3.1 servers (in docker containers) to talk to *not just the host* but also with *each other* over https... I am hitting an issue where the backend servers cannot talk to each other (even when I put them all in the same container --- says:
The SSL connection could not be established, see inner exception. Authentication failed because the remote party has closed the transport stream.
From the host side I can view the website via https but when the backend requests from another backend server the SSL error rears its head...
- Seems like maybe it must be to do with the underlying linux distro's root CAs then? Otherwise why would the same code + certificate work on windows but not inside docker (I followed this video and so the User Secrets and .pfx is all there...).
(I am using linux containers on windows).