This post gathers my recent reading notes on artificial intelligence, programming, and a few inspiring podcasts. It includes links to articles, tutorials, and fascinating discussions. Whether you're interested in the latest AI developments, .NET tools, or modern architectures, there's plenty here to spark your curiosity.
Vertical Slice Architecture with Jeremy Miller (.NET Rocks!) - This episode is about Vertical Slice Architecture, what it is, when it makes sense to use it, and some comparisons with the others that we know.
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.
During the holidays, I embarked on a fun project to create a visual countdown for important dates. Inspired by howmanysleeps and hometime from veebch, I wanted to build a countdown that didn't rely on Google Calendar. Instead, I used a Raspberry Pi Pico and some custom code to achieve this.
After cloning the repo, navigate to the src/NextEvent/ folder and use the Azure Developer CLI to initialize the project:
azd init
Enter a meaningful name for your resource group in Azure. To deploy, use the deployment command:
azd up
Specify the Azure subscription and location when prompted. After a few minutes, everything should be deployed. You can access the URL from the output in the terminal or retrieve it from the Azure Portal.
How to Set Up the Raspberry Pi Pico
Edit the config.py file to add your Wi-Fi information and update the number of lights on your light strip.
You can use Thonny to copy the Python code to the device. Copy both main.py and config.py to the Raspberry Pi Pico.
How It Works
The website creates a JSON file and saves it in a publicly accessible Azure storage.
When the Pi is powered on, it will:
Turn green one by one all the lights of the strip
Change the color of the entire light strip a few times, then turn it off
Try to connect to the Wi-Fi
Retrieve the timezone, current date, and settings from the JSON file
If the important date is within 24 days, the countdown will be displayed using random colors or the specified colors.
If the date has passed, the light strip will display a breathing effect with a random color of the day.
The Code on the Raspberry Pi Pico
The main code for the Raspberry Pi Pico is written in Python. Here's a brief overview of what it does:
Connect to Wi-Fi: The connect_to_wifi function connects the Raspberry Pi Pico to the specified Wi-Fi network.
Get Timezone and Local Time: The get_timezone and get_local_time functions fetch the current timezone and local time using online APIs.
Fetch Light Settings: The get_light_settings function retrieves the important date and RGB colors from the JSON file stored in Azure.
Calculate Sleeps Until Special Day: The sleeps_until_special_day function calculates the number of days until the important date.
Control the LED Strip: The progress function controls the LED strip, displaying the countdown or a breathing effect based on the current date and settings.
The Configuration Website
The configuration website is built in C#. It's a Blazor server webapp, and I used .NET Aspire to make it easy to run it locally. The UI uses FluentUI-Blazor so it looks pretty, without effort.
The website allows you to update the settings for the Raspberry Pi Pico. You can set the important date, choose custom colors, and save these settings to a JSON file in Azure storage.
Little Extra
The website is deployed in Azure Container App with a minimum scaling to zero to save on costs. This may cause a slight delay when loading the site for the first time, but it will work just fine and return to "dormant" mode after a while.
I hope you enjoyed reading about my holiday project! It was a fun and educational experience, and I look forward to working on more projects like this in the future.
What's Next?
Currently the project does a 24 days countdown (inspired from the advent calendar). I would like to add a feature to allow the user to set the number of days for the countdown. I would also like to add the possibility to set the color for the breathing effect (or keep it random) when the important date has passed. And lastly, I would like to add the time of the day when the light strip should turn on and off, because we all have different schedule 😉 .
Last thoughts
I really enjoyed doing this project. It was a fun way to learn more about the Raspberry Pi Pico, micro-Python (I didn't even know it was a thing), and FluentUI Blazor. I hope you enjoyed reading about it and that it inspired you to create your own fun projects. If you have any questions or suggestions, feel free to reach out, I'm fboucheros on most socials.
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.
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.
[](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 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!
Understanding C# 8 default interface methods (Andrew Lock) - Very clear post about the new feature available in interfaces, with great examples that make us understand why and when it is useful and how to implement it.
Code Visualization with CodeSee's Shanea Leven (Hanselminutes with Scott Hanselman) - Another very interesting episode. CodeSee definitely catches my attention, I'm planning to try it with my OSS project to get started.
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!
Going Full Time on Open Source with Shaun Walker (.NET Rocks!) - The older will remember the amazing DotNetNuke. That OSS project was create by Shaun a few years ago. In this episode, they talk about his new project and how he is building it.
Miscellaneous
How AI is generating change in newsrooms worldwide (Charlie Beckett) - An interesting post that look at a important question and impact of AI. I didn't thought about it, but of course news are affected by those generative AI tools.
.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...
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 VS Code editor extension (Tim Heuer) - The journey of a dev building an extension for Visual Studio Code.A very interesting post.
Open Source
Build an Open Source Project: Behind the Scenes (Alexey Yuzhakov) - This post shares a story of a real-life open source project. It's about putting in the effort and doing the extra work to make our project more useful and accessible.
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.
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.
Good Monday, it's time to share new ReadingNotes. Here is a list of all the articles, podcasts, and blog posts, that catch my interest during the week.
If you think you may have interesting content, share it!
Cloud
Azure Functions – 2022 update (Eamon O'Reilly) - So great to have news from the Azure Function team. Of course, I'm pretty happy about v4 isolated and the .NET updates but there is so much more.
DevContainers for Azure and .NET (Justin Yoo) - Dev Containers are so great. This post explains how they work, and lists many components to customize them. Here it's about .NET but all languages are supported.
Good Monday, it's time to share new ReadingNotes. Here is a list of all the articles, podcasts, and blog posts, that catch my interest during the week.
If you think you may have interesting content, share it!
.NET on Azure Functions Roadmap Update (Matthew Henderson) - The future looks very promising... :) And that also reminded me that I really need to upgrade one of my older functions.
Journey to the Cloud With ACA (Anthony Chu) - A perfect little tutorial showing how to build a one container App from nothing and end with a complete CICD workflow to deploy it into Azure.
Bye bye Azure Functions, Hello Azure Container Apps: Introduction (Jonathan George) - Great post about the reason behind a migration from Azure Function to Azure Container App. I really like reading all the questioning, going into the detail, planning the pricing, and the POC, this reflects the real life.
.NET now on Windows Package Manager (Ashita Nagar) - That's fantastic! I often have multiple versions of the framework installed because I try previews and so. With Winget I will be able to do some cleanup very easily.
back from a nice time off, I'm all recharged and it's time to share new ReadingNotes. Here is a list of all the articles, podcasts, and blog posts, that catch my interest during the week.
If you think you may have interesting content, share it!
Keys to Effective Regression Test Development (Amy Reichert) - This post shares a lot of info about test planning and structure. A nice read to get inspired and learn more on the topic.
315: A Proper Podcast (Merge Conflict) - Fun episode about Frank's and James' personal life.
How to have a hard conversation (Modern Mentor) - Those moments are hard and I believe we can all benefice from a few tips to prepare ourselves.
0267 - Serge Tremblay - Microsoft Loop (Visual Studio Talk Show) - (In French) Microsoft Loop?! If you have the same reaction as me when reading this title, then this episode is for you. A nice episode where three friends talk about new technology.
Good Monday, it's time to share new readingnotes. Here is a list of all the articles, and blog posts, that catch my interest during the week.
If you think you may have interesting content, share it!
The suggestion of the week
Deploy Azure Static Web Apps With Bicep | LINQ to Fail (Aaron Powell) - Great tutorial that explains how to build a well-structured deployment pipeline using bicep and GitHub action. I will need this for sure, bookmarked.
ApiController Attribute in ASP.NET Core Web API (Code Maze) - This post contained many best practices and detailed explanations to get a great API and make sure the user experience is the best possible.
New Resources to Get Started with .NET MAUI - .NET Blog (Matt Soucoup) - Are you planning to learn something new this summer? I suggest you .NET MAUI, to build an application that can go everywhere. This post shares tons of references to get you started.
Yes I know one day later, but it's still time to share my reading notes.
Those are a curated list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week and that I found interesting. It's a mix of the actuality and what I consumed.
If you think you may have interesting content, share it!
Cloud
50 shades of .NET on AWS (François Bouteruche) - A nice, like-real, story that helps understand how decisions are taken when planning in cloud architecture (here AWS).
Development Container CLI (Brigit Murtaugh) - Oh! This is fantastique, I need to try that, I'm assuming we will be able to give a name to the instance and that it will make reopening a container easier.
The Azure Cosmos DB Journey to .NET 6 - .NET Blog (Vinod Sridharan) - Learn how Azure Cosmo DB API gateway is low latency and use .Net in many different scenarios to achieve great performance, in this post.
It's Monday, time to share my reading notes. Those are a curated list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week and that I found interesting. It's a mix of the actuality and what I consumed.
If you think you may have interesting content, share it!
Configure Azure Cosmos DB Continuous Backups (Rajendra Gupta) - Backup can be so powerful! You could return in time just before an error to understand what happens... Or so many other scenarios.
How To Run PowerShell Scripts (Brien Posey) - A script can be frightening at first, but this nice post will help you to understand them better. Perfect for less technical people.
Introducing Qodana for Azure Pipelines (Anastasia Khramushina) - Qodana is can analyze your code in CICD on many platforms, and now also in the Azure DevOps.
Good Monday, 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!
Azure Cosmos DB SQL API – Document Analytics (Modhana) - Finding a good partition for our data is crucial to get the best performance. This post explains how with Celebrata we can visualize them and make smarter choices.
Miscellaneous
No one cares that you’re right (George Stocker) - Interesting post. the comparison of a compiler to humans made me smile, but it works...
Recently I participated in a series of videos about Azure Static Web Apps: Azure Tips and Tricks: Static Web Apps on Microsoft Channel 9. The series is perfect to get started and cover multiple different scenarios in different Javascript frameworks and C#. In this post, I wanted to regroup the four videos related to .Net Blazor. I also added the GitHub links part of the references at to end.
Prevent unwanted users to access your C# API by configuring authentication and authorization in your Blazor Azure Static Web Apps.
I hope those videos will help you to get started. If you have questions and/or comments don't hesitate to reach out (comments, DM, GitHub issues), it's always a pleasure.
In this video, I wanted to show one of the great features of Azure Static Web App Learn: the creation of pre-production environments. Using the CI/CD workflow, you can preview your pull requests changes before it's in production leveraging the automatic creation of pre-production environments!
Every Monday, I share my "reading notes". Those are a curated list of all the articles, blog posts, podcast episodes, and books that catch my interest during the week and that I found interesting. It's a mix of the actuality and what I consumed.
You think you may have interesting content, share it!
Cloud
How to Display the Current Azure Subscription in your CLI (Sam Cogan) - This is a game-changer for me. Every time I work in the terminal I was checking what was my current subscription (you don't want to deploy things in the wrong one right?) But know it will always be visible. Wonderfull!