Reading Notes #378



Cloud

Programming

Miscellaneous

Reading Notes #377

Cloud


Programming


Miscellaneous


Books



Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones (James Clear) - An excellent book that is very pleasant to read. I really appreciated the way things are broken in tiny pieces. I don't think this book re-invented the molecular physic, but by cutting, dissecting our habits that way it's hard to think that you can fail. It's easier to get started right now; even starting new habits before finishing the book!






~

    Reading Notes #376

    Cloud

    Miscellaneous

    Reading Notes #375

    Cloud

    Programming

    Podcast

    • Anthos Migrate, with Issy Ben-Shaul (Kubernetes Podcast from Google) - Nice update. I like the talk about Anthos it look like a great migration tool. I need to find that GitHub repo...

    Reading Notes #374

    Cloud


    Programming


    Podcast

    • Hevesh5 - Making a YouTube Career from Viral Domino Art (#46) (That Creative Life) - Great show. An amazing story.
    • Azure Functions using Node with Simona Cotin (.NET Rocks!) - Great show. I just switch my website following that Jam stack pattern. I was planning to use Azure Functions to add a few little twists.... I'm happy to see that I not alone thinking like that!
    • 0230 - Alain Vezina - Le métier du DevOps (Visual Studio Talk Show) - Super épisode, très intéressant d'entendre parler du rôle de DevOps de quelqu'un qui le vie au quotidien. Merci de la suggestion, je crois, bien que je suis du pour relire The Pheonix Project.
    • Goal Setting Tips & Tracking KPIs (Video Pursuit Podcast) - Really interesting episode. Everybody is talking about matrix and KPI... But it's not frequent to hear about the "how". I really like how the goals are explained, achievable, but not easy... And how we should react when we don't reach them.

    Miscellaneous


    ~ Good week!

    Reading Notes #373

    Cloud


    Programming


    Books



    Donald Miller

    A really interesting book that helps to focus and keep in mind the most important. I didn't read it with a purpose of business really, but it did make me remember past experiences and it was easy to make the relationship between success and when the story was clear. Take the time to read it, do the exercises/ reflections required... it's worth it.










    ~

    Reading Notes #372

    Suggestion of the week

    Cloud

    Programming


    Miscellaneous

    Reading Notes #371

    Cloud


    Programming


    Miscellaneous


    Deploy automatically a static website into an Azure Blob storage with Azure DevOps Pipeline

    Static websites are lightning fast, and running them inside an Azure Blob Storage instead of a WebApp is incredibly economical (less than $1/ month). Does it mean you need to do everything manually? Absolutely not! In a previous post I explained how to automatically generated your static website using a Build Pipeline inside Azure DevOps. In this post, let's complete the CI-CD by creating a Release Pipeline to deploy it.

    The Azure Resource Manager (ARM) Template


    First thing first. If we want our release pipeline to deploy our website in Azure, we need first to be sure our Resources are available "up there." The best way to do this is by using an Azure Resource Manager (ARM template). I will use the same project started in the previous post, feel free to adapt to your structure or copy it from it.

    Create a new file named deploy.json in the deployment folder. We need a simple storage account.

    {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "StorageName": {
                "type":"string",
                "defaultValue": "cloudenfrancaisv2",
                "maxLength": 24
            }
        },
        "variables": {},
        "resources": [
            {
                "type": "Microsoft.Storage/storageAccounts",
                "apiVersion": "2018-07-01",
                "name": "[parameters('StorageName')]",
                "location": "[resourceGroup().location]",
                "tags": {
                    "displayName": "[parameters('StorageName')]"
                },
                "sku": {
                    "name": "Standard_LRS"
                },
                "kind": "StorageV2"
            }
        ],
        "outputs": {}
    }
    

    I used a parameter (StorageName) to define the name of the storage account. This way I could have multiple pipelines deploying in different storages.

    Not to make the ARM template accessible to the release pipeline we also need to publish it. The easiest way to do it is to add another Copyfile task in our azure-pipeline. Add this task just before the PublishBuildArtifacts.

    - task: CopyFiles@2
    displayName: 'Copy deployment content'
    inputs: 
        SourceFolder: '$(Build.SourcesDirectory)/deployment'
        contents: '**\*' 
        targetFolder: $(Build.ArtifactStagingDirectory)/deployment
        cleanTargetFolder: true
    

    Once you commit and push these changes, it will trigger a build. When done, the ARM template will be available, and we will be able to start working on the release pipeline.

    The Release Pipeline


    Navigate to the DevOps project created in the previous post. This time, create a new Release Pipeline. When asked, select an empty template, we will pick manually the tasks we need.

    First, we need to define the trigger and where are our artifacts. Click on the thing at the left of the screen. Select the build projects and let's use the latest version of the artifact to our deployment.

    To get a continuous deployment, you need to enable it by clicking on the lightning bolt and selecting the enabled button.

    Now let's select our tasks. Click on the "+" sign to add new tasks. We need three of these: Azure Resource Group Deployment, Azure CLI, and Azure File Copy.



    Task 1 - Azure Resource Group Deployment


    The first one will be an Azure Resource Group Deployment. The will be used to deploy our ARM template and be sure that the resources are available in Azure.

    To configure the ARM deployment we need to select the Azure subscription and authorize the pipeline to have access. Then you will need to specify the name of the resource group you will be deploying into; it's location and finally points where is the linked ARM template.


    Task 2 - Azure CLI


    The second one is an Azure CLI. As I am writing this post, it's not possible to enable the static website property of a storage account. Therefore we will execute an Azure CLI command to change that configuration. Once you picked the Azure subscription, select inline script and enter this Azure CLI command:

    az storage blob service-properties update --account-name wyamfrankdemo --static-website  --index-document index.html
    

    This will enable the static website property of the storage account named wyamfrankdemo, and set the default document to index.html.

    Task 3 - Azure File Copy


    The last task is an Azure File Copy to copy all our files from $(System.DefaultWorkingDirectory)/drop/drop/outpout to the $web container (in our Azure Blob storage). The container must be named $web, that's the name used by Azure for the static website.

    Wrapping up


    Once you are done configuring the Release Pipeline, it's time to save it and run it. After only a minute or two (this demo is pretty small) the blog should be available into Azure. To find your endpoint (aka URL) you can go into the portal.azure.com and look at the static website property of the blob storage that we just create.

    In a video, please!


    I also have a video of this post if you prefer.