Applying Authorisation Rules to a Folder of Razor Components/Blazor Pages

A screenshot of a Blazor app designed to test/demonstrate different approaches to applying authorisation rules to razor components

There’s a lot of flexibility in how you can use authorisation rules in Razor components*, but a frustration of this approach is that it seems like you have to slap @attribute [Authorize(Policy = "PolicyName")] at the top or every page with no clear way of applying a given policy to a whole folder of .razor files. After much research and testing, I’ve found how to go about it!

Continue reading “Applying Authorisation Rules to a Folder of Razor Components/Blazor Pages”

So You Want to Run Azure Functions Using .NET 5

UPDATE 2021/11/09: Since the release of .NET 6 yesterday, there is reportedly day 0 support for .NET 6 across App Services and Azure Functions. Unless you have an absolute requirement to use .NET 5, the solution to using the latest and greatest .NET in Azure is .NET 6! I’ve left the rest of the blog post as it was just in case it helps someone, but I predict that it will become something of a relic now that it’s targeting an older version.

I’ve spent the last couple of evenings trying to get a set of Azure Functions migrated from .NET Core 3.1 to .NET 5 so that I can play around with some of the nice new syntax options, nullable contexts and the like. Since .NET 5 has officially been released, it would be justifiable to believe that it would be well supported across the core Microsoft product catalogue, such as in… say… Azure Functions?

Ha! You’re a funny one.

Continue reading “So You Want to Run Azure Functions Using .NET 5”