Everything as a code in Azure devops

Howdy Readers,

Today I’m not going to write much than sharing a list of blog posts that I came across. It is a nice read if you are interested in Azure DevOps or Deployment pipelines in General. Credit to JEREMY LINDSAY for creating everything-as-code-with-azure-devops-pipelines series.

Part 1 : C#, ARM and YAML

Part 2 : Multi-stage builds in YAML

Part 3 : Resource groups and YAML templates

Part 4 : Deploying an ARM template to create an Azure App Service with code

Azure AD login for Linux VMs from a security perspective

Azure and beyond

Hello Azure enthusiasts,

have you heard about Azure AD login for Linux VMs, a new preview feature on Azure AD? Have you given it a try? Well, I have and currently, I’m not yet fully convinced if it’s a curse or blessing in terms of governance and security. But first things first…

View original post 759 more words

Have your CAKE and eat it–implementing a C# build script at Huddle

Liam Westley - London developer

tldr; a build script should achieve several things; it can build and test your code locally, it can run (virtually unchanged) on a build server and it should be easy to understand for the developer of the application.

The Huddle Desktop application is written in C# for Windows and Mac. With CAKE we can finally have a single cross-platform build script, written in the language used to develop the actual application.


What Is CAKE?

CAKECake (C# Make) is a cross-platform build system using a C# DSL – built on top of the Roslyn compiler and available on Windows, Linux and macOS (https://cakebuild.net/). It is completely open source and hosted on GitHub.

You can get started by cloning an example repo, which is described over here; https://cakebuild.net/docs/tutorials/getting-started.

There are three key files – build.ps1 (PowerShell bootstrapper for Windows), build.sh (bash shell bootstrapper for Linux and macOS)…

View original post 1,134 more words

GDPR Support with ASP.NET Core 2.1


On May-25th, General Data Protection Regulation (GDPR) becomes active. With that many articles available on GDPR, I need to write one as well. However, this one is about ASP.NET Core. ASP.NET Core 2.1 includes built-in support to fulfill some GDPR requirements.

The ASP.NET Core 2.1 project template not only includes a privacy page, but also allows registered users to easily delete themselves, and to get all the information stored about the user.


Creating and Running the Project

All you need to do to get this support is to create a new ASP.NET Core 2.1 project and configure authentication to store user accounts in-app.

Configure Authentication

This creates a project with a privacy page (Views/Home/Privacy.cshtml) which needs to be filled with your content.

After creating the database with EF Core Migrations, the user can register, and after registration manage the account.

Register User

Using the Account Management, the user can download and delete all personal…

View original post 417 more words

First look of ML.NET: Microsoft Machine Learning framework for .Net

Neel Bhatt


Finally a Nuget package for Machine learning

I always wanted to have a Nuget package which can be plugged with a .Net application by which we can create Machine learning applications.

Microsoft has announced the Open source and Cross-platform Machine learning framework ML.NET

ML.NET first version

ML.NET is just a baby yet but it has already shown the capability of becoming a giant.

With its first version, we can perform Machine learning tasks like Classification, regression etc. Have a look here for some basic information for these ML algorithms.

Along with some basic algorithms – we can even train the model, predict using models along with other basic Machine learning tasks.

ML.NET can be extended to work with ML libraries like TensorFlow, Accord.NET, and CNTK etc.

A big picture


As you can see above, the framework can be extended to work with third-party libraries and it has some awesome…

View original post 471 more words

First steps with nullable reference types

Jon Skeet's coding blog

This blog post is effectively a log of my experience with the preview of the C# 8 nullable reference types feature.

There are lots of caveats here: it’s mostly “as I go along” so there may well be backtracking. I’m not advising the right thing to do, as I’m still investigating that myself. And of course the feature is still changing. Oh, and this blog post is inconsistent about its tense. Sometimes I write in the present tense as I go along, sometimes I wrote in the past tense afterwards without worrying about it. I hope this isn’t/wasn’t/won’t be too annoying.

I decided that the best way of exploring the feature would be to try to use it with Noda Time. In particular:

  • Does it find any existing bugs?
  • Do my existing attributes match what Roslyn expects?
  • Does the feature get in the way, or improve my productivity?



View original post 1,639 more words

Mendeley Suggest Architecture

A Practical Guide to Building Recommender Systems

Kris Jack, Ed Ingold and Maya Hristakeva.


Mendeley Suggest, a personalised research literature recommender, has been live for around nine months so we thought we’d mark this traditional human gestation period with a blog post about its architecture. We’ll present how the architecture currently looks, pointing out which technologies we use, justifying decisions that we’re happy with and lamenting those that we’re eager to reconsider.

Architectural Overview

A recommender system is more than just the smart algorithms that it implements. In fact, it’s a collection of five core components that are designed to interact with one another primarily to meet a set of user needs:

  • User Interface
  • Data Collection and Processing
  • Recommender Model
  • Recommendation Post-processing
  • Online Modules

In the case of Mendeley Suggest, we aim to provide users with articles that help them to keep up-to-date with research in their field and explore relevant research that is, as of…

View original post 2,372 more words

Using In Parameter Modifier : C# 7.2

Code Wala

Changes are the only constant thing in the world and that got little faster with C# new releases as we have minor now releases (also referred as point releases) with significant enhancements. New features are getting added and existing features are getting enhanced. In one my earlier posts, I discussed about Ref and Out improvements that took places in C# 7.0. You can go through the link below.

Ref and Out improvements in C# 7.0

Let’s have a quick look on it

Here we can see that if we want to pass the argument by ref then reference of the instance (value type or reference type) is passed and any change the in the argument in the called method reflects in the calling method as well.

Note – If you are curious about the using the ref keyword with reference type object, you can have a look to one of…

View original post 254 more words

Paramore Brighter: DRY with Custom Decorated Command Handlers

The Blog of Colin Mackay

You may wish to add similar functionality to many (or all) command handlers. The typical example is logging. You can decorate a command handler in a similar way to the policies I showed in previous posts to add common functionality. I’ve used this technique to guard the handler from invalid command arguments/parameters (essentially a validator), and for ensuring that we ping our APM (Application Performance Management) tool when a command completes. I’ll use the latter to demonstrate creating a custom decorator and handler to initiate this common code.

Paramore Brighter Command Processor will look for any attributes derived from RequestHandlerAttribute that are added to the Handle method on your command handler class. It will then use them to build a pipeline for your command.

So, in the example here, our attribute class looks like this:

 public class HeartbeatAttribute : RequestHandlerAttribute { public HeartbeatAttribute(int step, HandlerTiming timing = HandlerTiming.After) : base(step…

View original post 413 more words

Implementing Simple Neural Network in C#

Rubik's Code

Code that accompanies this article can be downloaded here.

Sometime in the last few weeks, while I was writing the explanations for the way in which neural networks learn and backpropagation algorithmI realized how I never tried to implement these algorithms in one of the programming languages. Then it struck me that I’ve never tried to implement the whole Artificial Neural Network from scratch. I was always using some libraries that were hiding that implementation from me so I could focus on the mathematical model and the problem I was trying to solve. One thing led to another and the decision to implement my own Neural Network from scratch without using third-party libraries was made. Also, I decided to use object-oriented programming language I prefer – C#.

This means that a more OO approach was taken and not the usual scripting point of view like we would have by…

View original post 1,725 more words

Serverless .Net Core(2.0) application with AWS Lambda: Step by step guide

Neel Bhatt

aws15Note – You can find the source code of my sample application here.

Amazon has recently announced the .NET Core 2.0 AWS Lambda runtime.

In this post, we will see how to create Server less .Net Core 2.0 application using AWS Lambda.

Let us first see what is Serverless computing?

  • Serverless computing allows you to build and run applications and services without thinking about servers
  • Serverless applications don’t require you to provision, scale, and manage any servers
  • You can build them for nearly any type of application or backend service, and everything required to run and scale your application with high availability is handled for you
  • Building serverless applications means that your developers can focus on their core product instead of worrying about managing and operating servers or runtimes, either in the cloud or on-premises.

Let us start Step by step guide.


View original post 466 more words

Best practices on Rest API client in Dotnet ecosystem

Howdy Readers,

Today I’m going to write something about HttpClient inspired by ASP.NET community standup. The popularities of microservices and REST API’s are on it’s highest peak. Which makes us using HttpClient the most. While you are calling rest API using HttpClient, you need to be aware of few most important things.

  1. Do not create a new instance of HttpClient class for each request. Creating new object will create two problems.
    • Each time the new connection will create a new connection pool for each request and it is a very costly operation as it includes 3-way handshake(HTTP) or even costlier TLS handshake(HTTPS)
    • The second issue with this is it may lead to socket exhaustion because in whichever operating system environment you are in, you have limited sockets. You may think that you will dispose the object of HTTP client and you might not have parallel users equivalent to no of sockets(64K) but there is a catch here. Once you dispose of the object, socket does not get freed up immediately. The different operating system takes the different amount of time to free up the sockets(say 3-5 seconds). Hence this may lead you to reach handle limit.
  2.  Do not create a single instance(static or singleton) of HttpClient. If you read the point one, you may conclude on creating the single instance of HttpClient because of it is thread-safe. This is said to be a more efficient way of creating HttpClient but it also has a serious issue. It will keep the connection open for a very long time. This has issue like
    • It may lead to not respecting load balancing. What I mean by this is if your connection is opened with server X then all requests from your application will go to the same server and other servers might be in idle state. This may be a big problem when you are one of the highest load generator client of that API.
    • The bigger problem comes when API uses things like Online-Offline (Blue-Green) deployment. On the toggle of API, Open connection with server keeps sending a request to it although it might have become an offline server.
    • You might have some default header which you might not want to share between different clients.

This Leads to a conclusion that keeping either single or transient connection can cause many issues. It is always recommended to create connections smartly, some of the examples might be to create client per request kind and also keep refreshing the connection over a period of time. There can be many such solutions but use it smartly according to your need.