Welcome to this week’s reading notes! In this post, you’ll find a curated selection of insightful articles and tutorials covering various topics in technology and programming. Whether you’re looking to enhance your testing skills with .NET Aspire, improve your code comprehension with GitHub Copilot, or explore the world of Docker for DevOps, there’s something here for everyone. Dive in and enjoy these valuable resources!
If you have interesting content, share it!
Suggestion of the week
Getting started with testing and .NET Aspire (Aaron Powell) - This is a great tutorial, with a video version if you prefer, to get us started with test when .NET Aspire is part obor solution.
Hosting a (DevOpsDays) Tech Conference (Dewan Ahmed) - I went to this even and you could feel it was prepared with patio and care. It very interesting to learn about the behind the scene and all the work put both before and after.DevOpsDay Halifax you won my heart.
It's reading notes time! It is a habit I started a long time ago, where I share a list of all the articles, blog posts, and books that catch my interest during the week.
You also read something you liked? Share it!
Suggestion of the week
Easily dock and float tool windows (Mads Kristensen) - Oh my! One of the best post I read since a long time. It cannot me more accurate, funny, nor useful.
How to Build Frontend Apps 10x Faster (Anmol Baranwal) - An interesting tools that you install that act as middle man and helps while developing and testing.
Incorporate GitHub Copilot into your daily flow (Rhea,Sinem,Mika) - Copilot go more accessible!This post summarizes how Copilot will be easier to use with suggested code. That's a good example of product feedback well used, everybody wins!
In this week’s Reading Notes, we explore cloud debugging, .NET Aspire, and more. Join us for insights, workshops, and podcasts covering a range of exciting topics! 🚀
Sharing my Reading Notes is a habit I started a long time ago, where I share a list of all the articles, blog posts, and books that catch my interest during the week.
Cloud
GalaSoft Laurent Bugnion (Laurent Bugnion) - Nice post debugging investigating a bug, that cannot be reproduce locally only in the cloud.... But with the right tools it's much easier.
Apprendre .NET Aspire en français (Frank Boucher) - Another shameless plug for French content this time. I did a 1h45 long video where I explain the basic of .NET Aspire by doing a workshop and providing details.
What is platform engineering? (Julia Kulla-Mader, Chuck Lantz) - Platform engineering is gaining in popularity, but what ibis really. This article gives a good explanation to start our learning journey.
It's reading notes time! It is a habit I started a long time ago, where I share a list of all the articles, blog posts, and books that catch my interest during the week.
You also read something you liked? Share it!
Cloud
Azure Developer CLI (azd) – Build 2024 Recap (Grace Kulin) - All developers should look at how it can really speedup and simplify your Azure deployment and ease the creation of your infrastructure as code file (bicep and terraform).
Announcing the AI Toolkit for Visual Studio Code (John Lam) - Nice! The favorite editor of so many now have an AI extension! I missed the Microsoft Build sessions with the demos. Lucky me they are available on demand!
I used to hardcode my password in my demos and code samples. I know it's not a good practice, but it's just for demo purposes, it cannot be that dramatic, right? I know there are proper ways to manage sensitive information, but this is only temporary! And it must be complicated to remove all the passwords from a deployment... It turns out, IT IS NOT difficult at all, and that will prevent serious threats.
In this post, I will share how to remove all passwords from a docker-compose file using environment variables. It's quick to setup and easy to remember. For production deployment, it's better to use secrets, because environment variables will be visible in logs. That said, for demos and debugging and testing, it's nice to see those values. The code will be available on GitHub. This deployment was used for my talks during Azure Developers .NET Days: Auto-Generate and Host Data API Builder on Azure Static Web Apps and The most minimal API code of all... none
The Before Picture
For this deployment, I used a docker-compose file to deploy an SQL Server in a first container and Data API Builder (DAB) in a second one. When the database container starts, I run a script to create the database tables and populate them.
As we can see, the password is in clear text twice, in the configuration of the database container and in the parameter for sqlcmd when populating the database. Same thing for the DAB configuration file. Here the data-source node where the password is in clear text in the connection string.
The easiest password instance to remove was in the sqlcmd command. When defining the container, an environment variable was used... Why not use it! To refer to an environment variable in a docker-compose file, you use the syntax $$VAR_NAME. I used the name of the environment variable MSSQL_SA_PASSWORD to replace the hardcoded password.
/opt/mssql-tools/bin/sqlcmd -U sa -P $$MSSQL_SA_PASSWORD -d master -i /startrek.sql
Second Pass: .env File
That's great but the value is still hardcoded when we assign the environment variable. Here comes the environment file. They are text files that holds the values in key-value paired style. The file is not committed to the repository, and it's used to store sensitive information. The file is read by the docker-compose and the values are injected. Here is the final docker-compose file:
Note the env_file directive in the services definition. The file .env is the name of the file used. The ${SA_PWD} tells docker compose to look for SA_PWD in the .env file. Here is what the file looks like:
SA_PWD=This!s@very$trongP@ssw0rd
Conclusion
Simple and quick. There are no reasons to still have the password in clear text in the docker compose files anymore. Even for a quick demo! Of course for a production deployment there are stronger ways to manage sensitive information, but for a demo it's perfect and it's secure.
During Microsoft Build Keynote on day 2, Julia Liuson and John Lambert talked about how trade actors are not only looking for the big fishes, but also looking at simple demos and old pieces of code, looking for passwords, keys and sensitive information.
It's reading notes time! It is a habit I started a long time ago, where I share a list of all the articles, blog posts, and books that catch my interest during the week.
Think Faster, Talk Smarter with Matt Abrahams (Modern Mentor) - Interesting episode about how to become a better communicators in both formal and informal situations. Matt is the author a book on that topic.
DevOps Adoption for IT Managers (Chris Pietschmann) - Interesting post that shares the benefits of DevOps for your enterprise and how to approach it as a manager.
Cascadia Code 2404.23 (Christopher Nguyen) - I used to do ASCII art back on my C=64... Now that all those new fonts and symbols are added should I start again? Nice to have all the options available to be able to display everything we need|the console.
In this post, I will share a few things that we need our attention when deploying a .NET isolated Azure Function from GitHub to Azure using the Zip Deploy method. This method is great for fast deployment and when your artefacts are zipped in a package.
Note The complete code for this post is available on GitHub
Understanding Zip Push/Zip Deploy
Zip Push allows us to deploy a compressed package, such as a zip file, directly to Azure. It could be part of a continuous integration and continuous deployment (CI-CD) or like in this example it could replace it. This approach is particularly useful when you want to ensure your artifacts remain unchanged across different environments or when aiming for the fastest deployment experience for users.
While CI-CD is excellent for keeping your code up-to-date, zip deployment offers the advantage of speed and consistency. It eliminates the need for compilation, leading to quicker uploads and deployments.
Preparing Your Package
It’s crucial to package with all necessary dependencies the code required. There is no operation to fetch any external packages during the deployment, the zip file will be decompressed and that's it. The best way to ensure you have everything you need is to publish your code, to a folder and then go in that folder and zip all the files.
dotnet publish -c Release -o ./out
Don't zip the folder, it won't work as expected.
You need to go inside the folder and select all the files and zip them to create your deployment artefact.
The next step is to make your artefact available online. There are many ways, but for this post we are using GitHub Realease. From the GitHub repository, create a new release, upload the zipped file created earlier and publish it. Note the URL of zipped files from the release.
Preparing The ARM Template
For this one-click deployment, we need an Azure Resource Manager (ARM) template. This is a document that describes the resources that we want to deploy to Azure. To deploy the zipped file into the Azure Function there are two particularities that required our attention.
Here we define an Windows Azure Function and the WEBSITE_RUN_FROM_PACKAGE needs to be set to 1. The WEBSITE_RUN_FROM_PACKAGE is the key that tells Azure to use the zip file as the deployment artefact.
Then to specify where the zip file is located we need to add an extension to the Azure Function.
The packageUri property is the URL of the zipped file from the GitHub release. Note the dependsOn property that ensures the Azure Function is created before the extension is added. The complete ARM template is available in the GitHub repository.
One-click Deployment
When you have your artefact and the ARM template uploaded to your GitHub repository, you can create a one-click deployment button. This button will take the user to the Azure portal and pre-fill the deployment form with the information from the ARM template. Here is an example of the button for markdown.
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FFBoucher%2FZipDeploy-AzFunc%2Fmain%2Fdeployment%2Fazuredeploy.json)
The has three parts, the first is the image that will be displayed on the button, the second is the link to the Azure portal and the third is the URL of the ARM template. The URL of the ARM template is the raw URL of the file in the GitHub repository, and it needs to be URL encoded. The URL encoding can be done using a tool like URL Encode/Decode.
Final Thoughts
Zip deployment is a powerful tool in your Azure arsenal by itself of part of a more complex CI-CD pipeline. It's a great way to make it easier for people to deploy your solution in their Azure subscription without having to clone/ fork the repository.
Video version
If you prefer, there is also have a video version of this post.
It's reading notes time! It is a habit I started a long time ago, close to 600 weeks ago in fact, where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Is Your Container Image Really Distroless? (Laurent Goderre) - Nice post that explains a new way to improve security and more while building our container by going distroless.
Azure PowerShell Tips and Tricks (Paul Harrison) - PowerShell is a very interesting and useful script language.All those tips are pure wisdom!
DevOps
Beautiful .NET Test Reports Using GitHub Actions (Sean Killeen) - It's true that the unit test result in Azure DevOps looks amazing. Pretty nice adaptation in GitHub Action, could/ should it be native?
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
The convenience of System.IO (Richard Lander) - An interesting exercise. I like doing these when for a project you need to determine what is the best solution to implement in your context.
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Hugo + VSCode + Docker = ❤️ (Aaryn Smith) - After an upgrade of Hugo or the theme, one of my site wasn't being generated anymore. Happy to to find a that devContainer, I will be able to investigate quickly.
Open Source
Windows Terminal Preview 1.19 Release (Christopher Nguyen) - Cool updates! I love that right-click web search! You know... when there is an error it will be so much efficient! An that was a community contribution! Fantastic!
How to rally support for your big idea (Modern Mentor) - Listening to winning strategies to make sure our biggest ideas have good start... It's always a good idea.
Community and Empowerment with Sharmadean Reid (A Bit of Optimism) - See ideas and challenges as a way to learn more, to learn maybe something different, to climb higher as Simon says, love it.
.NET Conf 2023 (Mehul Harry) - Net cof is coming reverse the dates! And for those if you who knows .NET there is a call for paper here is your chance the share your knowledge!
How to deploy Azure Container Apps (Shawn Sesna) - This is a grewt tutorial to get your container Apps deploy without having to care about to much infrastructure aka.kubernetes.
Kevin LaBranche: Leading teams through DevOps - Episode 251 (Azure DevOps Podcast) - Yes! DevOps is not a thing you implement in 2-3 weeks, it takes time. Great episode that highlight even more that it's not about the tech but the way you do things...
Monday! It is time to share my reading notes. It is a habit I started a long time ago where I share a list of all blog posts that catch my interest during the week.
If you think you may have interesting content, share it!
Debugging distributed systems is hard! (Dennis Frühauff) - This is a very nice post that explains clearly a situation. How many of us have been in this situation before where you try to debug a system and it's just so hard?
Healthcare and Life Sciences Blog (Kyle Raymond) - This is a cool tutorial/ example that explains what is and how to use semantic Kernel.
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Visual Studio Code Day 2023 (Burke Holland) - An event is coming up for VS Code and you don't want to miss that. During that one day, so much will be shared about this amazing editor.
Docker Gets up to Speed for WebAssembly (B. Cameron Gain) - Excited to see this wasm + docker story progressing. Should I give it a try or wait a little more... That's the questions
Choosing a container platform (Kit Dergilev) - This is a great post that shares different options for our container environment based on some scenarios.
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Cloud
Microsoft Cost Management updates—March 2023 (Michael Flanakin) - Because we all need it and or worry about it. Learn the new features that are available for you in the cost management.
Logic Apps Aviators Newsletter - April 2023 (Kent Weare) - One of my friends shared this with me, and I loved it! It's packed with information about new features, and upcoming events...
This Month in Azure Container Apps: March/April 2023 (Anthony Chu) - I caught the live stream by pure chance and they pass through all the news contained in the post. Very happy to see Azure Container App growing so quickly!
How to Do an Inner Join in LINQ? (Code Maze) - Nice post to get started about relations between tables type of joints and of course how to do it with LINQ.
Running .NET Console Apps in Azure Container Instances (Mark Heath) - A neat way to run an application in the cloud. Have a special look at how the secret config is managed to avoid pushing them into the code repository.
Podcast
Let's Chat About AI (Ep 76) (Community Pulse) - Extremely interesting episode about AI. Should we be worried, what would be the impact? So many great questions asked.
Down A Rabbit Hole with Seth Godin (A Bit of Optimism) - Great episode is about many different little things to make life better. You can feel the complicity between Seth and Simon.
Windows WSL and Containers in 2023 (DevOps and Docker Talk) - WSL what it is and why people say it's so useful. All that and more in this episode.
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Creating a ToolTip Component in Blazor (Steven Giesel) - What a nice little gem! This is a fantastic tutorial that explains how to create custom components.
GitHub Copilot for the Command Line is amazing! (Christian Heilmann) - Wow! Those explanations are a huuuuge plus. Not only Copilote helps us at that time but then it also helps us to learn and improve. I like that. Looking forward to use it.
344: Exploring CoreData and CloudKit (Merge Conflict) - Honestly it felt good hearing about those two genius struggling with data. But more than that to see them continue to look for different alternatives, and try new tools and patterns. Great episode, as usual.
Learning Blazor (David Pine) - This book is just perfect! It explains a bit of everything. It is packed with real examples and code variation (because there are so many ways to write something). There was even a full chapter un test with playwright, I didn't expect that and it was great!
It is time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week.
If you think you may have interesting content, share it!
Programming
Web3 DevOps: The Series (Donovan Brown) - I'm just getting started with web3 there are so many tools.
How to Compare Two Json Objects Using C# (Code Maze) - Data is the core of most if not all applications and a common way to define the data is JSON. This post helps to understand how to compare a piece of information. Very useful.
Taking Comfortable Risks with Scott Galloway (A Bit of Optimism) - One thing he said that will stick with me I think, and that I need to now transform into my words: "There is nothing that will happen to you if you don't take some uncomfortable risks and talk to some people".
How to manage through a season of layoffs (Modern Mentor) - A season like those required more effort from everyone. It's hard and we all need to say nice and as much human as possible.
Already time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week.
If you think you may have interesting content, share it!
The Suggestion of the week
What is .NET, and why should you choose it? (.NET Team) - This is not an ordinary blog post. It makes me think of those deep interesting MSDN articles. A great read for young or older developers that would like to know more about .NET or refresh their memory.
Cloud
Azure DevOps Pipelines: If Expressions and Conditions (John Folberth) - This nice post in the series on Azure Pipeline focuses on conditions. Avery has efficient tools to customize our pipeline just like we want them.
What is an Azure Load Balancer? (Cary Roys) - Do you know what an Azure Load Balancer is or you only thing you know? In this nice post not only you will learn what it really is but it the post shares some OSS tools to test your ALB and explains how to use them.
Programming
Asynchronous Programming Patterns in .NET (Code Maze) - This is a great tutorial that explains 3 asynchronous patterns with code samples and explanation. Perfect to get started and understand legacy code or write new one.
Coding 102: Writing code other people can read (Max Pekarsky) - This is an excellent post with so much wisdom in it. Writing readable code is extremely important. Whether it's just a few lines in excel, a script, a query for a database, or a full app.
Sustainable Open Source with Sarah Novotny (.NET Rocks!) - Great episode with the Microsoft Open Source Lead talking about why truly open source is important and how Microsft really believes in its future.
Digging Up the Past with Sarah Parcak (A Bit of Optimism) - Using satellite images to do archeology... wait what?! Great episode really interesting from the early second until the last one.
Already time to share new reading notes. It is a habit I started a long time ago where I share a list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week.
You think you may have interesting content, share it!
Generating Sample Data with Bogus (Shawn Wildermuth) - We all need seed data, test data, temp data... Bogus seams sample and efficient. I'm definitely trying it, in my next project.
It's been a while since I had so many "ah-ah" moment while reading a book. Digital body language is about communication using many different technologies by different culture, generations and individuals...
It a must if you care about how your message are received.
Get Started with GitHub Actions (Mandy Hubbard) - This is a great post to get started with CICD. GitHub is free and accessible, give it a try and then automate some tests or a deployment.
Why tuples in C# are not always a code smell (Dennis Frühauff) - I didn't use Turple yet but it's not hard to see the potential and how it could become ugly. This post shows and explains a few simple rules to stay clear.
Lazy and once-only C# async initialization (Ian Griffiths) - An amazing post that explains so much and that has all the code snippets to be clear about it. I will have to copy-paste those into some test applications to really try them, but it is clear what I should expect.