Remote Debugging for Azure Functions Can Be a Breeze (Simon Timms) - A nice post that gives a little bit of history and architecture information, before showing how to use the product named Ozcode for debugging.
- I really liked this book. In fact, As I was reading the first chapter I was "earing" Adam's voice. So instead of creating that voice in my head I bought the audiobook and let Adam himself tells me his story. This is the best book I listen to this year. It was inspiring and empowering.
Every beginning of weekend, I will share a recap of the week and at the same time a summary of my streams. Those videos are at least two hour longs, so I thought a short summary to know if topic interest you could be useful. Watch only the summary or relax and enjoy the longer version that up to you!
Let's get Started with Containers on Azure (Erik
St. Martin) - c5m.ca/aaa-ep18
Let's build a website with Node.js on Azure (Tiemey Cyren) - c5m.ca/aaa-ep19
Adding all functionalities from previous version into TinyBlazorAdmin website - c5m.ca/stream-ep115
DevOps Lab: Demystifying ARM Templates: Variables (Abel Wang) - c5m.ca/learn-arm-ep5
Monitoring the new followers, displaying the highest scores in order - c5m.ca/stream-ep116
Stop Pushing Down Your Emotions (Developer Tea) - I think a lot of people are doing that, me included. Very interesting podcast about a real situation.
How the OBS Project changed video forever with lead Hugh Bailey (Hanselminutes with Scott Hanselman) - I was trilled to listen to this podcast. I'm a regular user of OBS and it was wonderful to learn more about this project. I will definitely be lurking on the GitHub side...
Episode 219: Remote crickets and Manager Careering (Soft Skills Engineering) - A really nice episode. Great topics answering diverse questions. One that kept my attention was about the magic manager and the time management...
How to Improve Time Management with Angela Proffitt (Influencer Entrepreneurs with Jenny Melrose) - A few great tips to improve our efficiency at managing time. It's always good to have new ideas and ear how others are doing.
Every beginning of weekend, I will share a recap of the week and at the same time a summary of my streams. Those videos are at least two hour longs, so I thought a short summary to know if topic interest you could be useful. Watch only the summary or relax and enjoy the longer version that up to you!
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!
All Things Azure with Dwayne Monroe (Screaming in the Cloud) - People asked me those questions very often: Why Azure? How did you start? Dwayne's answer is excellent... Great podcast honest and true.
15 Statistics You Should Know About A Career In UX Design (Ben Aston) - Interesting post that does the tour of the UX job. I wished I had that kind of information on all types of jobs back in the day. If you are considering UX its a must.
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!
Building a notifications client with Xamarin and Azure (Laurent Bugnion) - A very nice post that describe how Laurent started to build his cross platforms tools. Sharing the gotchas and a few tips along this first post of the series.
7 principles for modern tech leaders (William Peachey) - Nice post about the evolution of roles in our field of expertise and what could/ should be a a leader roles.
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!
Unit Testing in ASP .NET Core 3.1 (Shahed C) - A nice post that shows how to get started with xUnit the voted most popular test framework.
Miscellaneous
APIs in the 2020s Panel (.NET Rocks!) - A virtual panel of awesome speakers that talked about API, REST, GraphQL, oData and so more. Lovely episode.
471: How to Say No Without Saying No, with Lois Frankel (Coaching for Leaders) - Saying No... being open. Really interesting topic. I put Lois Frankel: Nice Girls Don’t Speak Up or Stand Out in my to read list, that book maybe written for women in mind, but I think it is really interesting.
Leveraging Our Emotional Goals (Developer Tea) - An interesting episode that talk about goals and what we need to do (or not) to achieved them.
203: Updating Open Source Projects (https://castbox.fm/episode/203%3A-Updating-Open-Source-Projects-id2117504-id267802246) - As I just create my first version in one of my open-source project I found the topic more than interesting... Thank you, great show.
How to Stop Windows 10 Updates (5 Methods) (Mohammed Siddiqui) - I think you should only prevent auto-update when you really know what you are doing. Updates are easy to forget and therefore your PC could be at risk. That said, sometime it could really be a must.5misc.windows.update]
An incredible adventure yes around the globe, but more important over the personal limits. I found this book very inspiring. I felt following him across the Antarctica... In the blizzard or in those deep moment. Great memoir, great adventure.
Most solutions, if not all, are composed of multiple parts: backend, frontend, services, APIs, etc. Because all parts could have a different life-cycle it's important to be able to deploy them individually. However, sometimes we would like to deploy everything at once. It's exactly the scenario I had in a project I'm working on where with backend and one frontend.
In this post, I will explain how I use nested Azure Resource Manager (ARM) templates and conditions to let the user decide if he wants to deploy only the backend or the backend with a frontend of his choice. All the code will be available in GitHub and if you prefer, a video version is available below. (This post is also available in French)
The Context
The project used in this post my open-source budget-friendly Azure URL Shortener. Like mentioned previously the project is composed of two parts. The backend leverage Microsoft serverless Azure Functions, it a perfect match in this case because it will only run when someone clicks a link. The second part is a frontend, and it's totally optional. Because the Azure Functions are HTTP triggers they act as an API, therefore, they can be called from anything able to do an HTTP call. Both are very easily deployable using an ARM template by a PowerShell or CLI command or by a one-click button directly from GitHub.
The Goal
At the end of this post, we will be able from one-click to deploy just the Azure Functions or to deploy them with a frontend of our choice (I only have one right now, but more will come). To do this, we will modify the "backend" ARM template using condition and nest the ARM template responsible for the frontend deployment.
The ARM templates are available here in there [initial](https://github.com/FBoucher/AzUrlShortener/tree/master/tutorials/optional-arm/before) and [final](https://github.com/FBoucher/AzUrlShortener/tree/master/tutorials/optional-arm/before/after) versions.
Adding New Inputs
We will nest the ARM templates, this means that our backend template (azureDeploy.json) will call the frontend template (adminBlazorWebsite-deployAzure.json). Therefore we need to add all the required information to azureDeploy.json to make sure it's able to deploy adminBlazorWebsite-deployAzure.json successfully. Looking at the parameter required for the second template, we only two need values AdminEMail and AdminPassword. All the other can be generated or we already have them.
We will need also another parameter the will act as our selection option. So let's add a parameter named frontend and allowed only two values: none and adminBlazorWebsite. If the value is none we only deploy the Azure Function. When the value is adminBlazorWebsite we will deploy the Azure Function, of course, but we will also deploy an admin website to go with it.
Following the best practices, we add clear detail and add those three parameters in the parameters section of the ARM template
"frontend": {
"type": "string",
"allowedValues": [
"none",
"adminBlazorWebsite"
],
"defaultValue": "adminBlazorWebsite",
"metadata": {
"description": "Select the frontend that will be deploy. Select 'none', if you don't want any. Frontend available: adminBlazorWebsite, none. "
}
},
"frontend-AdminEMail": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "(Required only if frontend = adminBlazorWebsite) The EMail use to connect into the admin Blazor Website."
}
},
"frontend-AdminPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "(Required only if frontend = adminBlazorWebsite) Password use to connect into the admin Blazor Website."
}
}
Nested Templates
Let's assume for now that we always deploy the website when we deploy the Azure Function, to keep things simple. What we need now is to used nested ARM template, and that when you deploy an ARM template from inside another ARM template. This is done with a Microsoft.Resources/deployments node. Let's look at the code:
If we examine this node, we have the classic: name, type, dependsOn, resourceGroup, apiVersion. Here We really want the Azure Functions to be fully deployed so we need the FunctionApp to be created AND the GitHub sync to be complete, this is why there is also a dependency on Microsoft.Web/sites/sourcecontrols.
In properties we will pass the mode as Incremental as it will leave unchanged resources that exist in the resource group but aren't specified in the template.
The second property is templateLink. This is really important as it's the URL to the other ARM template. That URI must not be a local file or a file that is only available on your local network. You must provide a URI value that downloadable as HTTP or HTTPS. In this case, it's a variable that contains the GitHub URL where the template is available.
Finally, we have the parameters, and this is how we pass the values to the second template. Let's skip those where I just pass the parameter value from the caller to the called, and focus on basename, AzureFunctionUrlListUrl, and AzureFunctionUrlShortenerUrl.
For basename I just add a prefix to the parameter basename received, this way the resource names will be different but we can still see the "connection". That's purely optional, you could have added this value in a parameter to azureDeploy.json, I prefer keeping the parameters a minimum as possible as I think it simplifies the deployment for the users.
Finally for AzureFunctionUrlListUrl, and AzureFunctionUrlShortenerUrl I needed to retrieve the URL of the Azure Function with the security token because they are secured. I do that by concatenating different parts.
Component
Value
Beginning of the URL
'https://'
Reference the Function App, return the value of hostname
Now that the second ARM template can be deployed, let's add a condition so it gets, indeed, deploy only when we desire. To do this it's very simple, we need to add a property condition.
In this case, is the value of the parameter is different then none, the nested template will be deployed. When a condition end-up being "false", the entire resource will be ignored during the deployment. How simple or complex are your conditions... that's your choice!
Bring your own machine to Visual Studio Online | Visual Studio Blog (Allison) - Fantastic news! Before it was possible to access a powerful developer environment from our poor local devices. Now we can also access our own powerful machine from elsewhere! That's very very nice!
195: The Hanselman Machine Learning Model (Merge Conflict) - Great episode where Frank and James discuss how James could build a sentiment analysis of Hanselman tweets, is it possible or not and what would be the cost (effort, and money).
GitHub Actions with Enrico Campidoglio (.NET Rocks!) - I think it's my first .Net Show since the Pandemie. Well with was a create show that dig deeper in the GitHub Action. Loved it.
068: How to Build Your Personal Brand (CloudSkills.fm) - I really liked this episode as I did "created" my personal brand (without really realizing it ) a few years ago.
455: How to Create Great Relationships, with Colleen Bordeaux (Coaching for Leaders) - Interesting discussion with the author of the book: Am I Doing This Right?: A Philosophical Guide to Life in the Age of Overwhelm, that is now in my to read list/
Every Monday, I share my "reading notes". Those are 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.
Blazor by Example - A dismissable banner (Jon Hilton) - A really interesting post that explains how to build a webpage by showing it by iterations. If you know me, you know those are my favorite.
0240 - Anthony Giretti - Le protocole gRPC (Visual Studio Talk Show) - Nice episode where they talk about gRPC and gRPC web, where it comes from, why it's different than the previous version, and how it's possible to use it with .Net. All that in French!
Every Monday, I share my reading notes. Those are 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.
Visual Studio Code January 2020 (VSCode Team) - How this team manages to pack so many goodies in every new version is a mystery. Wonderful.
Podcasts
Influencer Marketing EXPLAINED (by an influencer) (That Creative Life) - What a great episode! She can't barely contain herself... that's how Sara is passionate and honest! I love the show, great episode!
Colin O'Brady - First to Ever Cross Antarctica COMPLETELY Unassisted (That Creative Life) - I have been waiting for someone to write a book like that forever! Thank you to let me discover Colin O'Brady. I already order the book... looking forward to reading it. Life IS the ultimate adventure, a mandatory listening for all of us!
#25: Shayne Boyer - Social Coder (The Solo Coder Podcast) - Once again a very nice episode. It was wonderful to discover my colleague to this interview. Well done.
Making Gatsby easy to understand with Laurie Barth (Software Engineering Unlocked) - That how you do an interview! Great conversation, Lauria is fantastic. I didn't know her but now I'm following, and waiting for the next "question".
Every week, I publish my reading notes. Those are the articles, blog posts, podcast episodes, and books that catch my interest and that I found interesting. It's a mix of the actuality and what I was looking for.
Cloud
Azure Functions with QueueTriggers and .NET Core – Configuration and Troubleshooting (Jeff) - Poor Jeff, I was there on his stream and he struggles so much to understand what was happening. And honestly me too! Despite the fact that I know and use Azure Function regularly I completely missed the missing instruction... The good news is since the documentation is open-source we can improve it...
Programming
A quick overview of ASP.NET Core with Rider (Rachel Appel) - I never used Rider in a real project. However, the quality of this code IDE is not in question. It looks awesome and this post shows how it supports the latest version of .Net Core.
Visual Studio Extensions: 8 You Should Check Out (Carlos Schults) - A nice post that shares useful extensions for developers. I also like the fact that in the title it's 8 and in the url it's 7 LOL...
I'm still balanced about this book. It was a good book, even if I found some chapters that were too long. I also got lost by moments. I had the impression that some thoughts or ideas were not developed correctly and more quickly wrapped. In counterpart, some were very well served and clear.
Setting expectations for open source participation (Brett Cannon) - Excellent post (also available in video) about open source, where based on his experience the author share with us great advice. Thanks, Aaron for that reading suggestion.
Nothing new here but it's clear and very well explained. Honestly it good to revisit those productivity/ focus habits... It helps to stay on our toes...
Serverless Deployment Best Practices (Fernando Medina Corey) - A nice post that shows some of the best practices for serverless and how AWS implements them.
Why jQuery is Obsolete and Time to Stop Using It (Chris Love) - Great post. I was a big user of jQuery, and these days I do less front end stuff, so it is nice to see how things have evolved and to understand the impact jQuery had.
We all do it. We create resources in the cloud for a demo, or a presentation and forget about them. Then at the end of the month, we receive a bigger invoice then expected and it's the panic.
This is why I thought about AzSubscriptionCleaner. It's an open-source project that could be deployed in your subscription very easily. The goal is to have it deployed by one click directly from GitHub.
The tool can be deployed in two versions, using Azure Automation, or Azure Functions. Based on a schedule it will execute a query to search all resources with a tag expireOn with the value is older than now(), and delete them.
I wrote two blog posts, paired with a YouTube video that explain how to tools where built.
This is an open-source project github.com/FBoucher/AzSubcriptionCleaner, you are welcome to see the code, clone the repository, ask for more feature or do a pull request to add a new one!
How To Develop Apps Like PUBG (Apoorv Gehlot) - An interesting article that gives us an idea of how a game like pugs got that success, and who they manage that rapid growth.
It's so nice to be able to add some serverless components in our solution to make them better in a snap. But how do we manage them? In this post, I will explain how to create an Azure resource manager (ARM) template to deploy any Azure Function and show how I used this structure to deploy an open-source project I've been working on these days.
Part 1 - The ARM template
An ARM template is a JSON file that describes our architecture. To deploy an Azure Function we need at least three recourses: a functionApp, a service plan, and a storage account.
The FunctionApp is, of course, our function. The service plan could be set as dynamic or describe the type of resource that will be used by your function. The storage account is where is our code.
In the previous image, you can see how those components interact more with each other. Inside the Function, we will have a list of properties. One of those properties will be the Runtime, for example, in the AZUnzipEverything demo, it will be dotnet. Another property will be the connection string to our storage account that is also part of our ARM template. Since that resource doesn't exist yet, we will need to use the dynamic code.
The Function node will contain a sub-resource of type storageAccount. This is where we will specify where is our code, so it cant be clone to Azure.
Building ARM for a Simple Function
Let's see a template for a simple Azure Function that doesn't require any dependency, and we will examine it after.
The first resources listed in the template is the Account Storage. There nothing specific about it.
The Service Plan
The service plan is the second resource in the list. It's important to notice that to be able to use the SKU Dynamic you will need at least the API version of apiVersion to be "2018-02-01". Then you specify the SKU.
"sku": {
"name": "Y1",
"tier": "Dynamic"
}
Of course, you can use the other SKU if you prefer.
The Function App
Final resources added to the mixt, and this is where all the pieces are getting together. It's important to notice that the other in which the resources are listed are not considered by Azure while deploying (it's only for us ;) ). To let Azure knows you need to add dependencies.
This way the Azure Function will be created after the service plan and the storage account are available. Then in the properties we will be able to build the ConnectionString to the blob storage using a reference.
The last piece of the puzzle is the sub-resource sourcecontrol inside the FunctionApp. This will define where Azure should clone the code from and in which branch.
To be sure that everything is fully automatic the properties publishRunbook and IsManualIntegration must be set as true. Otherwise, you will need to do a synchronization between your Git (in this case on GitHub), and the Git in Azure.
Of course, all the source code of both the Azure Function and the ARM template are available on GitHub, but let me highlight how the containers are defined from an ARM template.
Just like with sourcecontrol, we will need to add a list of sub-resources to our storage account. The name MUST start by 'default/'.
Part 2 - Four Deployment Options
Now that we have a template that describes our needs we just need to deploy it. There are multiple ways it could be done, but let's see four of them.
Deploy from the Azure Portal
Navigate to the Azure Portal (https://azure.portal.com), from your favorite browser and search for "deploy a custom template" directly in the search bar located at the top of the screen (in the middle). Or go at https://portal.azure.com/#create/Microsoft.Template. One in the Custom deployment page, click on the link Build your own template in the editor. From there, you can copy-paste or upload your ARM template. You need to save it to see the real deployment form.
Deploy with a script
Would it be in PowerShell or in Azure CLI you can easily deploy your template with these two commands.
In Azure CLI
# create resource group
az group create -n AzUnzipEverything -l eastus
# deploy it
az group deployment create -n cloud5mins -g AzUnzipEverything --template-file "deployment\deployAzure.json" --parameters "deployment\deployAzure.parameters.json"
In PowerShell
# create resource group
New-AzResourceGroup -Name AzUnzipEverything -Location eastus
# deploy it
New-AzResourceGroupDeployment -ResourceGroupName AzUnzipEverything -TemplateFile deployment\deployAzure.json
Deploy to Azure Button
One of the best way to help people to deploy your solution in their Azure subscription is the Deploy to Azure Button.
You need to create an image link (in HTML or Markdown) to this to a special destination build in two-part.
However, this URL needs to be encoded. There is plenty of encoders online, but you can also do it from the terminal with the following command (A big thanks to @BrettMiller_IT who showed me this trick during one of my live streams).
Clicking the button will bring the user at the same page on the Azure Portal but in the user subscription.
Azure DevOps Pipeline
From the Azure DevOps portal (https://dev.azure.com), select your project and create a new Release Pipeline. Click on the + Add an artifact button to connect your Git repository.
Once it's added, you need to add a task the current job. Click on the link 1 job, 0 task (4). Now you just need to specify your Azure subscription, the name of the resource group and select the location of your ARM template inside your repository. To make the deployment automatic with each push in the repository, click that little lightning bolt and enable the Continuous deployment trigger.
Wrapping-up
Voila, you know have four different ways to deploy your Azure Function automatically. But don't take my word for it, try it yourself! If you need more details you can visit the project on GitHub or watch this video where I demo the content of this post.
I recently presented, a workshop at the TOHack to get started with Azure. The goal was to try different Azure services, and see how we could augment an existing website using serverless function and artificial intelligence. (Aussi disponible en français)
During this workshop, a website is deployed automatically from GitHub. Then by adding an Azure Function and using the Vision API of Azure Cognitive Services, the final solution is able to detect when uploaded pictures are or not dogs and keep our image folder "clean". We call that application: The automatic Not a Dog application.
The step by step instruction with the code can be found on GitHub - Not-a-Dog-Workshop. The workshop can be done in about 45-60 minutes.
I also did a video that is available on my YouTube channel:
You have questions, you are blocked, it will be a pleasure to help you.