Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Reading Notes #564


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!

 

Cloud

DevOps

Programming

Data

~Frank

Reading Notes #533


Good Monday!
It's time to share my reading notes. Those are a curated list of all the articles and blog posts, that caught 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

Programming

Miscellaneous

~Enjoy!


Reading Notes #505

Me, thinking I could work with the dogs

Good Monday, Already time to share new reading notes. Here is a list of all the articles, blog posts, and podcast episodes that catch my interest during the week.

If you think you may have interesting content, share it!

Cloud

Programming

Miscellaneous

~frank


Reading Notes #495


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. 


Suggestion of the week

  • Include diagrams in your Markdown files with Mermaid (Martin Woodward, Adam Biagianti) - This is very interesting. For a simple little diagram, we can now do that in text in the same document... Looking forward to trying it. Mermaid is also supported in Azure DevOps

Cloud

Programming

Book



Author: Matthew McConaughey

This autobiography is funny, light, interesting, and even weird at some moments. But you know what? I liked it. I totally kept some quotes, as I found them good. I partially read it and listen to it. The audio version is done by Matthew and it's nice to hear him telling us his story.




~frank

 

Reading Notes #493


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. 

Just for the of it, I did a little funny video to answer the question: Where really is cloud computing? 

Watch it on your favorite platform ;) YouTube - TikTok

Cloud

Programming

Podcasts


~Frank

Reading Notes #475


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!

The suggestion of the week

  • What makes a good Git commit? (Al Tenhundfeld) - Great post. It's always good to read opinions from others about collaborating as it helps to better understand others, be in their shoes, and then become a better team player.

Cloud

Programming

Miscellaneous

  • Diagram as Code with Diagrams (Sam Cogan) - Interesting tool, I use drawio most of the time because it doesn't require any installation, but I am curious to see it.

  • Speaking CTO (Gregor Hohpe) - Nive post with really good and simple best practices.


~Frank

Reading Notes #468

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

Programming

Miscellaneous


~Frank


Reading Notes #467

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!


This week's image brings us to 2017, back when I was a Microsoft MVP, yes my name is on that wall with so many of my friends! Have I great summit this week!

Cloud

Programming

Miscellaneous


~Frank

Reading Notes #462


Every Monday, I share my "reading notes". This is a curated list of all the articles, blog posts, 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.


Cloud

Programming

Miscellaneous


~Frank

Reading Notes #461

Every Monday, I share my "reading notes". This is a curated list of all the articles, blog posts, 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.

The suggestions of the week

Cloud

  • What Is Azure Functions (Mahesh Chand) - The great simple post that explains what is an Azure Function and how to create/ debug/ deploy one

Programming

Podcast

  • Épisode 11 - La famine en Ukraine (Les Pires Moments de l'Histoire) - OMG! I have nothing else to say. I knew that part of the history was dark and complex... but I knew nothing. Great episode.
  • 633 - How to Use Rejection to Your Advantage (Modern Mentor) - In our lives, we will encounter many nos or rejection. This episode talks about how you could use those detours to learn more, and transform them in opportunities.

Miscellaneous


You think you may have interesting content, share it!

~Frank


Reading Notes #454


Cloud


Programming


Podcast


Books


Every Tool's a Hammer: Life Is What You Make It
 

(Adam Savage) 

- 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.

Reading Notes #453


Cloud

Programming

Miscellaneous

Podcasts

  • What is a Developer Game Jam? (Coding Blocks) - Interesting episode about Game Jam... I barely know that universe. Yes, I said universe because it is a completely different world or better another dimension. There are tons of events and participants but you may never hear of that. It's very interesting.

  • A Blast from the Past and Life's Interesting Journey — Back After 8 Years (The Smart Passive Income Online Business and Blogging Podcast) - Inspiring episode about how communities can be built and be interesting.

How to configure a secured custom domain on a Azure Function or website

I wanted to create this tutorial for a long time. How to map a naked domain on an Azure resource. It looks so complicated, but once you know what to do it's kind of simple in fact. In this post, I will share the three simple steps to do exactly this.

Step 1: Add Custom Domain


The first step is to map a domain on the application. The method I will explain uses a "www" domain (ex: www.fboucher.dev). To map directly a naked domain (ex: fboucher.dev) you would need to buy a wildcard certificate. However, I will show you in step three how to walk around this issue by using DNS rules.

From the Azure portal, open the Azure Function or App Service. From the left menu search for "custom", click the Custom domains option. In this panel click the button Add custom domain, and enter your www domain.



Click the validate button and follow the instruction to make the connection between the App Service and your domain provider.

Step 2: Adding a Certificate


Now that your custom domain is mapped, let's fix the "not secure" warning by adding a certificate. From the Azure portal return in the App blade. Repeat the previous search for "custom", and select the option TLS/SSL settings. Click the Private Key Certificates, and the Create App Service Managed Certificate button. Select the domain previously added and saved. It will take a few moments to create the certificate.



Go back in the Custom domains blade and click the Add binding button. Select the domain and certificate, don't forget to select the SNI SSL option and click the Add Binding button.




Step 3: Create the DNS Rules

Create an account in cloudflare.com and add a site for your domain. We will need to customize the DNS and create some Page Rules.



On the cloudflare.com note the 2 nameservers addresses. Go to the origin name provider (in my case godaddy) and replace the names of the nameservers with the value found on cloudflare.



Create a rule that will redirect all the incoming traffic from the naked-domain to www.domain. On the option on the top, click the Pages Rules (B). Then Click the Button Create Page Rule



In the field for If the URL matches: enter the naked-domain follow by /*. That will match everything coming from that URL

For the settings select Forwarding URL and 301- Permanent Redirect. Then the destination URL should be https://www. with your domain and /$1.




References

🔗 Map an existing custom DNS name to Azure App Service: https://c5m.ca/customDomain 

🔗 Secure a custom DNS name with a TLS/SSL binding in Azure App Service: https://c5m.ca/tls-ssl

Reading Notes #451

Cloud


Programming


Miscellaneous


Podcast

Books


A Game Plan for Life: The Power of Mentoring

Author: John Wooden, John C. Maxwell

What a great book. I didn't know John Wooden before, but I am very impressed and inspired by both coach Wooden and the author. There is so much in this book and worth reading it again... But first, let's get prepare :)

Reading Notes #449


Cloud

Programming

Miscellaneous

Reading Notes #442


Cloud

Programming

Reading Notes #438



Cloud


Programming


Miscellaneous

Reading Notes #434

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


Programming


Podcasts


Miscellaneous


~☁️


Reading Notes #428


Frank in Kayak smilling at the camera
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


Programming


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.

Miscellaneous


Books

Cover of the Book The Impossible first.
  The Impossible First: From Fire to Ice—Crossing Antarctica Alone

  Author: Colin O'Brady

  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.





~enjoy!

 

Simplify your deployment with nested Azure Resource Manager (ARM) templates


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:

{
    "name": "FrontendDeployment",
    "type": "Microsoft.Resources/deployments",
    "dependsOn": [
        "[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]",
        "[resourceId('Microsoft.Web/sites/sourcecontrols', variables('funcAppName'), 'web')]"
    ],
    "resourceGroup": "[resourceGroup().name]",
    "apiVersion": "2019-10-01",
    "properties": {
        "mode": "Incremental",
        "templateLink": {
            "uri": "[variables('frontendInfo')[parameters('frontend')].armTemplateUrl]"
        },
        "parameters": {
            "basename": {
                "value" : "[concat('adm', parameters('baseName'))]"
            },
            "AdminEMail": {
                "value" : "[parameters('frontend-AdminEMail')]"
            },
            "AdminPassword": {
                "value" : "[parameters('frontend-AdminPassword')]"
            },
            "AzureFunctionUrlListUrl": {
                "value" : "[concat('https://', reference(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '2018-02-01').hostNames[0], '/api/UrlList?code=', listkeys(concat(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '/host/default/'),'2016-08-01').functionKeys.default)]"
            },
            "AzureFunctionUrlShortenerUrl": {
                "value" : "[concat('https://', reference(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '2018-02-01').hostNames[0], '/api/UrlShortener?code=', listkeys(concat(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '/host/default/'),'2016-08-01').functionKeys.default)]"
            },
            "GitHubURL": {
                "value" : "[parameters('GitHubURL')]"
            },
            "GitHubBranch": {
                "value" : "[parameters('GitHubBranch')]"
            },
            "ExpireOn": {
                "value" : "[parameters('ExpireOn')]"
            },
            "OwnerName": {
                "value" : "[parameters('OwnerName')]"
            }

        }
    }
}

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.

Learn more about the Azure Resource Manager deployment modes here as they are very powerful.

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 reference(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '2018-02-01').hostNames[0]
Specify the Function targeted in this case UrlList. And starting the querystring to pass the code (aka. security token) '/api/UrlList?code='
Using the new listkeys function to retrieve the default Function key. listkeys(concat(resourceId('Microsoft.Web/sites/', variables('funcAppName')), '/host/default/'),'2016-08-01').functionKeys.default

Conditional parts


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.

{
    "name": "FrontendDeployment",
    "type": "Microsoft.Resources/deployments",
    "condition": "[not(equals(parameters('frontend'), 'none'))]",
    "dependsOn": [
        "[resourceId('Microsoft.Web/sites/', variables('funcAppName'))]",
        "[resourceId('Microsoft.Web/sites/sourcecontrols', variables('funcAppName'), 'web')]"
    ]
}

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!

Happy deployment. :)