SignalR + .NET Core – Unable to handshake, negotiate return 204

This is a very common issue with setting up SignalR 1.1 on .NET Core, the 204 Negotiate sent from the SignalR client may take you hours to figure out.

The problem is setting up Cross Origin Policy. You should move the Cors setup to Configure section on the Startup file. So far this is a solution, I will investigate more of the cause and update this post later.


app.UseCors(builder =>






Deploy Webpack React app (not using create-react-app) to Heroku

If you are starting on web-development in 2018, I am sure all or at least most of your frontend projects are by default built and bundled using Webpack.

To setup Webpack app, please find this article

This post is mainly aimed at people who are already using Webpack applications in their personal, GitHub or even client projects to successfully deploy and host their web applications on Heroku.

1. Build an express server

The first step is to build a simple express server to serve your application.

What is an Express server you ask?
An Express is a web-application framework that basically runs on a node environment. In our case it serves our application from a port available in the same environment.

We are going to build a simple standard express server to serve our index.html file after Webpack generated all the bundles.

const express = require('express');
const path = require('path');
const port = process.env.PORT || 8080;
const app = express();
// the __dirname is the current directory from where the script is running
// send the user to index html page inspite of the url
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, 'index.html'));

In your webpack.config.js file, if you have the following code, you will see a bundle.js generated at the root of your application.

module.exports = {
entry: [
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'

Now that we are here finally, close to deployment, we need to add two lines of script in our package.json file. Add these two following commands under the scripts section.

"scripts": {
  "start": "node server.js", // serves the application
  "heroku-postbuild": "webpack -p" // runs after installation


Remove entire column in all documents in mongodb

The syntax of remove Address column out of all User document
upsert: false value which does not insert a new document when no match is found.
multi: true, updates multiple documents that meet the query criteria. If set to false, updates one document.

{ $unset: {'Address': 1}},

Kill un-commit transaction on SQL Server

When developer use SQL Server to create any transaction, sometimes they forget to rollback the transaction with begin transaction statement. It will cause the Timeout for the database as the transaction is still remain open.

The following steps will help you to solve the problem.

Check if any open transaction here: DBCC OPENTRAN

Kill the UId which is open if any with: KILL 80

Adding Cache to ASP.NET MVC Bundles

Sometimes after changing styles, javascript on the application, it still got cached on the end-user browser. The solution for it is adding the version to stylesheets, javascript files with the following format ?v=[whatever the random version number]. However, in .NET MVC, if you use Bundling and Minification through BundleConfig, then you should add the following code to BundleConfig file

BundleTable.EnableOptimizations = true;

Jenkins Pipeline build for NodeJs app

The common issue if you are using Jenkins on Docker image provided by DigitalOcean is the build always failed if we build the solution with NodeJs.

After I tried to install NodeJS Plugin in Jenkin and build the NodeJs App, the error came up which causes the build failed was env: ‘node’: No such file or directory.

Problem: NodeJs is not installed in Docker Jenkins, even the install NodeJs plugin on Jenkin


SSH into Docker container Bash/Shell: docker exec -it eager_payne /bin/bash

Install NodeJs with command: apk add nodejs

Access Azure Kubernetes Cluster from Azure Cli

az aks install-cli
az aks get-credentials --resource-group 'resource name' --name 'name of your cluster'
az aks browse --resource-group 'resource name' --name 'name of your cluster'

Azure Cli will browse your resource in cluster and you will be able to accessed your K8s cluster via

How do I perform native backups of an RDS SQL Server DB instance?

I want to perform a native backup of my Amazon Relational Database Service (Amazon RDS) SQL Server DB instance so that I can store the backup file in Amazon Simple Storage Service (Amazon S3), or use the backup file to restore an RDS instance later.
Short Description
Amazon RDS supports native backup and restore for Microsoft SQL Server databases. You can create a full backup of your on-premises database, store the file in Amazon S3, and then restore the backup file to an existing Amazon RDS DB instance running SQL Server. You can also restore this backup file to an on-premises server or to a different Amazon RDS DB instance running SQL Server.


To set up a native backup of the SQL Server database, use the following services:

An Amazon S3 bucket to store your backup files
An AWS Identity and Access Management (IAM) role to access the bucket
The SQLSERVER_BACKUP_RESTORE option added to an option group on the DB instance
Note: Create the S3 bucket in the same Region as your RDS DB instance.

Open the Amazon RDS console, and then choose Option Groups in the navigation pane. Choose Create Group, and enter the name, description, engine, and engine version of your server. Then, choose Create.
Select the option group that you created, and then choose Add Option. Choose “SQLSERVER_BACKUP_RESTORE“. It’s a best practice to create a new IAM role and then choose Add Option, so that your IAM role has the required privileges. Choose your S3 bucket, or create a new S3 bucket. Then, choose Apply Immediately and Add Option.

Associate the option group with the DB instance by choosing Databases in the navigation pane, and then choose the instance to back up. Choose Actions, and then choose Modify.

Under Database Options, choose the option group that you created, and then choose Apply Immediately and Continue. Review the information, and then choose Modify DB Instance. This option group modification has no downtime because instance reboot is not required.

When the status changes from modifying to available, connect to the DB instance through SQL Server Management Studio, and then choose New Query. Enter one of the following SQL statements to initiate the backup of the desired database:
Initiate backup for unencrypted databases

exec msdb.dbo.rds_backup_database
@source_db_name=’database_name’, @s3_arn_to_backup_to=’arn:aws:s3:::bucket_name/file_name_and_extension’,

Initiate backup for encrypted databases

exec msdb.dbo.rds_backup_database
@s3_arn_to_backup_to=’arn:aws:s3:::bucket_name/file_name_and_extension’, @kms_master_key_arn=’arn:aws:kms:region:

Note: Replace database_name, bucket_name, file_name_and_extension, region, account-id, and key-id listed in these examples to match your scenario. You can use the backup file, generated in the S3 bucket, to restore a new RDS DB instance. When the rds_backup_database or rds_restore_database stored procedure is called, the task starts and outputs the information about the task.

When the lifecycle status of the task is SUCCESS, the task is complete. You can then open the Amazon S3 console, choose the bucket in which you created the backup, and view the backup file. You can download this file, or use the file to restore a new RDS DB instance.

Use one of the following SQL statements to restore from the backup file available in the S3 bucket:

Restore unencrypted databases

exec msdb.dbo.rds_restore_database

Restore encrypted databases

exec msdb.dbo.rds_restore_database
@s3_arn_to_restore_from=’arn:aws:s3::: bucket_name/file_name_and_extension’,

You can get the Task ID after you perform the backup or restore statement. Or, you can use the following script to identify all the completed and pending tasks for a particular database:

exec msdb.dbo.rds_task_status @db_name=’database_name’

To track the status of the job, use this SQL statement:

exec msdb..rds_task_status @task_id= 5