Showing all posts tagged: '.NET Core'

A 20-post collection

.NET Core authentication and authorisation using Auth0

I'm a big proponent of delegated authentication. It's no surprise that [Broken Authentication](https://www.owasp.org/index.php/Top_10-2017_A2-Broken_Authentication" target="_blank) is #2 at the OWASP top 10 latest report. It's been #2 for a very long time, which means that developers and enterprises are still getting this wrong. There are so many ways that authentication that can go wrong, that delegated authentication should be the preferred and possibly the default choice for all platforms. There are many different services that can provide this. I've heavily worked with Azure AD and Azure AD B2C …[read more]


Using 'User Secrets' in .NET Core Console apps

Managing sensitive information and secrets in config files is something we all have to deal with on a daily basis. Unfortunately, this is also something that we still get wrong: a) config files with production secrets/keys b) source controll littered with secrets/keys c) obscure file transformations and processes to update secrets as we move from one environment to another. However, there are a few options available to us. For local development, NET Core has the notion of User Secrets which we can use to store sensitive information outside the application folder and away from source control. Azure Key …[read more]


Combining data from multiple sources in Azure Search

Azure Search is a great service that allows developers to add search functionality in their applications. I blogged about [how to index and query data from SQL Server using Azure Search](GHOST_URL/indexing-and-searching-sql-server-data-with-azure-search/" target="_blank) before. Today, I want to talk about a more advanced scenario and one that could be more common than you think. By default, every Search index is designed to pull data from one source. The source can be a SQL Database, a blob storage or Azure Table Storage. However, there are valid scenarios where you may want to combined data from multiple …[read more]


Scaffolding DbContext and Models with EntityFramework Core 2.0 and the CLI

EF Core 2.0 has been out for a few weeks now. If you're looking at an ORM for your .NET application then EF Core should be at the top of the list of possible options. I say at the top and not the only one because depending on the project requirements, some features may be missing. For example, EF Core cut ties with .edmx so if you want to stick with the designer feature you will need to use EF6. There are other limitations so make sure you have a look at [this post](https://docs.microsoft.com/en-us/ …[read more]


Getting started with Azure Container Instances

Hot off the press! The new [Azure Container Instances](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-overview" target"_blank) service is a new offering (still in Preview) from Azure that allows you to launch and run your Docker Images in less than 10 seconds. In this post, I'll show you how to get started and what you need in order to be able to leverage the service. Prerequisites In order to follow along you'll need the following: An active Azure Subscription A machine that has the following installed Azure CLI Docker .NET Core (if you want to deploy …[read more]


.NET Core Dependency Injection with constructor parameters

This post will be short and sweet, albeit one that caused me a bit of a headache. I recently worked on an ASP.NET Core project and I wanted to take advantage of the built-in Dependency Injection service to inject various services to the controllers. However, one of the services required a parameter in the constructor. This is not highly unusual so I was expecting to quickly find an example in the official docs, explaining how to do this. My search, however, returned no results. I then turned to Google/Bing but guess what? Nothing. Every example I found re-iterated …[read more]


Securing Azure Storage Tables with SAS authentication and CORS in .NET

I'm currently working on a side project as an excuse to try some of the latest code features and functionality in [.NET Core](https://www.microsoft.com/net/download/core" target="_blank). It's a small project with a couple of models and basic CRUD. The project is going to touch everything new such as ASP.NET Core 2.0 Preview, .NET Standard 2.0 Preview, [Azure Storage SDK for .NET Core](https://www.nuget.org/packages/WindowsAzure.Storage" target="_blank)etc. It was a conscious decision as I wanted to see how the latest tooling and …[read more]


Securing ASP.NET Core application settings using Azure Key Vault

Azure Key Vault is one of my favourite services, competing for first place with Azure Functions. And .NET Core is my favorite framework for writing applications. Imagine, then, my suprise when I found out that my favorite tools can now work together! [Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started" target="_blank ) is a cloud service for storing sensitive "secrets" and (encryption) "keys". Key Vault is simple, easy and indispensible when developing secure applications. It helps avoid the complexity of storing sensitive information in configuration files. This can be API passwords, …[read more]