Showing all posts tagged: '.NET Core'

A 19-post collection

Configure and use User Secrets in .NET Core 2.0 Console apps in development

Managing sensitive information and secrets in config files is something we have to deal with on a daily basis. Unfortunately, this is also something that we still get wrong. In many cases, secrets spill from production to development and vice versa or we have to setup up obscure file transformations and processes to change said secrets as we move from one environment to another. .NET Core has introduced the notion of [User Secrets](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?tabs=visual-studio" target="_blank) which we can use to store application variables outside the application folder. …[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](https://cmatskas.com/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 …[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]


EF Core migrations with existing database schema and data

I'm currently working on an inherited .NET Core project and I'm loving the experience. I'm still using the project.json project format instead of the newer *.csproj & msbuild one. For now I'll leave it as it is but going forward I'll use the new format for subsequent ASP.NET Core projects. The project also makes use of the newest [EF Core](https://docs.microsoft.com/en-gb/ef/" target="_blank) so it's all running on the edge of the .NET technology. EF Core Code First is great but the tooling is still rough around the edges. Some things …[read more]