.NET Injection of a dependency list

.NET Injection of a dependency list

Whilst doom scrolling Twitter last night, I came across a tweet by a Norweigan software developer named KarlSolgard; he tweeted about a feature of .NET Core Dependency Injection that I was unaware existed.

Injecting a class or a factory is something that every .NET developer has come to know; however, you can inject an IEnumerable of something. By registering multiple implementations of an interface, your classes can ask for an array of concrete implementations of that interface.

Read more

Using Postman Securely

Using Postman Securely

I will skip over any jokes about using a postman and go straight to the subject at hand, using Postman securely.

What is Postman?

Postman is a desktop and browser-based application that many developers use for calling or testing APIs; it also has additional features for testing and automating API workflows. However, this post is not to teach you about Postman but to teach you how to use it securely; if you want to learn more about Postman and how to use it, read the documentation on postman.com.

The Postman Cloud

One of the key features of Postman is its ability to store your API Collections in the cloud; you can access your collections from anywhere and share them with your team. However, this means that the collection, including sensitive information, is stored on Postman’s servers. Depending on the sensitivity of your data and any rules at your organisation, you may be happy with this, or you may not (a question to ask your security team, not a question for my blog to answer!).

Read more

Clean up your durable functions history

Clean up your durable functions history

Recently I have been working with Azure Durable Functions, which are an extension of the Azure Function platform. Durable Functions provide a way to define a workflow that maintains a state between executions or during asynchronous runs of each part of the workflow.

I intend to write several posts on Azure Functions in the coming months, but for now, I want to write about cleaning up after durable function workflows, as it took me some time to work out how to do it myself.

Durable Function History

If you already understand how durable functions maintain their state and history, scroll down to the next section; otherwise, keep reading to learn how durable state works.

Every output of a durable activity (or the orchestrator itself) is stored as part of the orchestration history; one of the requirements of activity functions is that their return type can be serialised and deserialised, and stored in JSON format. This JSON data is then stored in Azure Storage (blobs, queues, and tables) to be retrieved when the function resumes (after waiting on an activity or external event).

What isn’t immediately apparent to developers is that this history is stored forever, an ever-growing pile of JSON in your storage accounts.

Read more

New Year, new habits, and new passwords?

New Year, new habits, and new passwords?

As we wave goodbye to the pain that was 2020, some people are looking for a different kind of New Years Resolution; even one that they might follow for once! I am looking to improve my fitness; working from home gives me more free time, the lack of which was always my reason for not exercising! Another kind of fitness is “Digital Fitness”; the first and perhaps most crucial step in improving your Digital Fitness is security, stronger passwords being an easy first step.

Beef up those Passwords.

We are often told that we should use long and complex passwords; but remembering them is hard, especially for those who do not use them regularly. This then results in the less savvy user simply changing a part of their password (like a number) each time they get forced to create a new password; this way they can remember one long password with a slight change rather than a new long password every ninety days.

Read more