title: Home.md
date: 2020-11-16 00:00:00+02:00
draft: false

Set up built-in authentication for Azure Static Web App

This is the second part in a series covering Azure Static Web Apps. In the previous post I showed how to deploy a static web app. The web app was deployed successfully and open to the public to visit. What if you want to restrict access to the app to just a few users you trust? Azure Static Web Apps offers a couple of solutions without having to write a lot of code.

Deploy Azure Static Web App using Bicep and YAML pipeline

When you build some kind of web application it might be interesting to have a look at Azure Static Web Apps. This is a very light weight service which doesn’t have to cost much, and can even be free. This is the first in a series of posts about Azure Static Web Apps. In this post I will start with the basics and show how to deploy a html page to a free Static Web App.

Get function configuration from deployed Function App

When you deploy an Azure Function app you also deploy the configuration for each function within the app. What if you would like to inspect the configuration of a function within a function app? If the function is using a timerTrigger, you might want to be able to look at that schedule for example. That would be easy to do using the Azure Portal, but what if you need to do it using PowerShell?

Deploy Azure Function App without downtime

Deploying a function app without downtime should be standard practice for anyone working with Azure Functions, but it does not come out of the box. It requires an understanding of how function apps gets configured, how deployment slots can help and why warmup does not necessarily mean your solution is up and running. In this post I will go through how this can be achieved using CD-pipelines in Azure DevOps.

Moving from Blogger to GitHub Pages using Hugo

For a while now I have felt that it takes too long time for me to write blog posts. I spend a long time figuring out how to make the post look right, when I should be spending time on the content. In the end this puts me off writing, because I know it will require a lot of effort. Because of that I have now moved the blog from Blogger to GitHub Pages using Hugo as static site generator to make it easier and quicker to write content.

Pester 5: Discovery and TestCases

Pester 5 was released a couple of days ago which brings a lot of new features and changes to how we write tests. One of the major changes in Pester 5 is the Discovery phase. In this post I will attempt to explain how Discovery works and how to use it to generate test cases. Tests are executed in two phases Whenever you run tests with Pester 5 there will always be two phases, the Discovery phase and the Run phase.

Create and use Azure Table storage with PowerShell

Azure Table storage is a quick and easy way to store data in the cloud. If you have an Azure subscription you can play around with you are up and running within minutes. Here is a short example on how to get started. Create table To create an Azure Table we need to first have a resource group. Lets create one that is called “MyAwesomeResourceGroup” and place it in “West Europe”.

Use Edit-Command to discover the code behind built-in cmdlets

Did you know that there are a lot of built-in cmdlets which are written entirely in PowerShell? Did you also know that you can view the source of those cmdlets? Well, you can. Get-Command shows all the details we need. When you run Get-Command you get all kinds of details about the commands you are looking for. One of the properties in the output is called ScriptBlock. That’s where the code is, if its written in PowerShell.

Invoke-RestMethod with anti-forgery tokens in header and cookie

To help prevent cross-site scripting attacks some websites uses anti-forgery tokens. If you would like to talk to a REST API which uses this security measure you might run into problems if you are trying to use the PowerShell cmdlet Invoke-RestMethod. I have seen some people suggesting that Invoke-RestMethod does not have support for this, which is not true. It’s just a little bit more complicated than expected. What’s needed is basically a custom header and a cookie.

Introducing the IniManager module

Some time ago I wanted to find a DSC resource which would help me in configuring ini files. I did not really find any resource which was dynamic enough for my needs so I ended up writing my own. Since I want my DSC resources to contain as little code as possible I prefer to create cmdlets outside of the resource which I can call from within the resource. In this way I can also use the cmdlets in scripts and the console which is a nice bonus.