.Net Core 2.0 deployment on AWS

core 7

In my previous post, I have explained how to setup your .Net Core 2.0 which you can find here.

In this post, I will explain how to deploy your .Net Core 2.0 application into AWS Elastic Beanstalk.

First of all, let us see what is AWS Elastic Beanstalk?

AWS Elastic Beanstalk is an orchestration service offered from Amazon Web Services for deploying infrastructure which orchestrates various AWS services, including EC2, S3, Simple Notification Service (SNS), CloudWatch, autoscaling, and Elastic Load Balancers.

Please note that Elastic Beanstalk currently has Core 1.0 and it will be soon updated to have Core 2.0

If you want to know about the .Net Core 1.0 deployment then have a look here.

So I will explain what can be done to deploy your Core 2.0 application on Elastic Beanstalk until the platform is updated to support Core 2.0

All we need to do is to add aws-windows-deployment-manifest.json file into our Core 2.0 application.

aws-windows-deployment-manifest.json is used to instruct Beanstalk to install .NET Core 2.0 on the instance during deployment.

Add below lines into to aws-windows-deployment-manifest.json file:

{
  "manifestVersion": 1,
  "deployments": 
  {
    "aspNetCoreWeb": [
    {
      "name": "app",
      "parameters": {
      "appBundle": ".",
      "iisPath": "/",
      "iisWebSite": "Default Web Site"
    },
      "scripts": {
      "preInstall": {
      "file": "./Scripts/installnetcore20.ps1"
       }
     }
   }
  ]
 }
}

Basically, above lines instruct Elastic Beanstalk to deploy .Net Core application.

But we want to deploy .Net Core 2.0 application, so for that we need to execute the ./Scripts/installnetcore20.ps1 PowerShell script which is already mentioned in above json file.

Now we need to add this ./Scripts/installnetcore20.ps1 Powershell file into Core 2.0 application.

Add below lines into PowerShell file:

$localPath = 'C:\dotnet-sdk-2.0.0-win-x64.exe' if(!(Test-Path $localPath)) { Invoke-WebRequest -Uri 'https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-sdk-2.0.0-win-x64.exe' -OutFile $localPath & $localPath /quiet /log c:\InstallNetCore20.log }

Above script downloads the .NET Core 2.0 installer and run the installer from the Microsoft site.

As we know that many times it is possible that link is broken or changed so in this case another option is to put Core 2.0 installer into the S3 bucket of AWS application (I did that way)

Our .Net Core 2.0 application looks as below:

core6

Another way is using Docker image if your application is Docker basked.

If you know any other way then please suggest in below comment section.

Advertisements

Best tools for S3 : Amazon Web Service(AWS)

s3

All those who are using AWS might have a requirement to download\sync\upload etc with your S3 bucket.

There are several ways to achieve that which includes some third party tool and even there are some ways via Visual Studio.

Let us check them one by one, we will take the example of downloading entire S3 bucket using below tools:

AWS CLI

The AWS Command Line Interface is a unified tool that provides a consistent interface for interacting with all parts of AWS.

Install AWS CLI using command sudo pip install awscli and then follow below command to download entire S3 bucket:

aws s3 sync s3://mybucket 

Using s3cmd and S3Express

s3cmd is a third party tool which is a Command Line S3 Client and Backup for Linux and Mac and S3Express is Command Line S3 Client and S3 Backup for Windows.

You can download it from above link.

Once downloaded you can configure it as below:

s3cmd --configure
s3cmd sync s3://bucketnamehere/folder /destination/folder

You can even create and remove buckets using above tools. Have a look here for more details.

Using Visual Studio

You can download entire S3 bucket using Visual Studio. For that, you would be required to download AWS toolkit for visual studio which can be downloaded from here.

Once it is installed, go to Visual Studio – AWS Explorer – S3 – Your bucket – Double click

In the window, you will be able to select all files. Right click and download files.

Using Cyberduck

One more awesome tools for this is Cyberduck.

Cyberduck is a Libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift browser for Mac and Windows.

It just requires your AWS credentials and you can use the simple interface to download/upload/sync any of your buckets/folders/files.

Using Rclone

Rclone is a command line program to sync files and directories to and from

  • Google Drive
  • Amazon S3
  • Openstack Swift / Rackspace cloud files / Memset Memstore
  • Dropbox
  • Google Cloud Storage
  • Amazon Drive
  • Microsoft OneDrive
  • Hubic
  • Backblaze B2
  • Yandex Disk
  • SFTP
  • The local filesystem

You can sync your S3 bucket by giving below commands:

rclone sync /home/local/directory remote:bucket

Using S3Browser

S3 Browser is also one tool which can be used for above purpose. It is windows only tool.

S3 Browser is a freeware Windows client for Amazon S3 and Amazon CloudFront. Amazon S3 provides a simple web-services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. Amazon CloudFront is a content delivery network (CDN). It can be used to deliver your files using a global network of edge locations.

If you know any other awesome tools then do share it here.

Happy learning.

Amazon Rekognition : The rise of Artificial intelligence

reko14

By looking at the word Rekognition you would feel as if it is a wrongly spelled word 🙂 It is nothing but an awesome gift from Amazon to us.

First let us see some background, I attended a training of Artificial intelligence some days back and in that training, we were shown below picture and were told to recognize what it is:

reko9

Within a second everyone said it is an elephant. We can recognize this elephant within seconds because we have years of experience of learning.

Then trainer asked what if a system wants to recognize it within seconds, is it possible? It might be very difficult because if we compare our years of experience with a system’s experience then there is a huge difference, we will have to teach the system to identify what is there in an image.

But the answer of trainer’s question is yes, it is possible with the help of AI. There are millions of images already there on the internet which can be used for Big Data or for AI.

Let us get back to Amazon Rekognition.

It was introduced in re:Invent of Amazon in 2016:

reko1

So basically it takes the image as input and returns data which can be used for different analysis purpose.

So what is Amazon Rekognition?

Amazon Rekognition is a service that makes it easy to add image analysis to your applications.

With Amazon Rekognition you can:

  • Detect objects
  • Detect scenes
  • Detect faces
  • Search and compare faces
  • Identify inappropriate content in images

Amazon Rekognition provides:

reko3

  • Object and Scene Detection
  • Image Moderation
  • Facial Analysis
  • Face Comparison
  • Facial Recognition

Let us see some use cases for different features of Amazon Rekognition:

Facial Recognition:

reko8

Sentiment Analysis:

reko7

Face-Based User Verification:

reko6

Image Moderation:

reko5

Searchable Image Library:

reko4

Interesting isn’t it?

Below are few screenshots of the actual Amazon Rekognition application:

reko10

reko11

reko12

You can see more details about the API and step by step process here if you want to know more.

It may remind you about the God’s eye from the movie The Fast & furious 7\8. That day is near as well with the rise of AI along with AWS 🙂

Happy learning.

Encryption in Amazon Simple Queue Service (SQS)

encryption-locks

As I come from .Net background, I have always used MSMQ which is obviously very good. Now a days I am working a bit with Amazon Simple Queue Service(SQS) and I find it very cool.

Amazon Simple Queue Service (SQS) is a fully-managed message queuing service for reliably communicating among distributed software components and micro services – at any scale.

Recently Amazon has added one more useful feature into SQS which is Server-Side Encryption.

In the context of Message Queuing, encryption is the process for encoding and decoding messages, ensuring they cannot be read or used by unauthorized persons so now Amazon SQS is even more secured than before.

It gives you ability to store encrypted messages in either standard queue or FIFO queue. You can add it while creating new queue or you can set it in any existing queue as well.

AWS by default provides standr key for all customers which is unique and it is called  Customer Master Key (CMK). You can use this key or you can create your own keys for encryption. If you choose to use your own keys, don’t forget to update your KMS key policies so that they allow for encryption and decryption of messages.

sqs_set_encrypt_2

So what exactly it encrypts in SQS?

It encrypts the body of a message in an Amazon SQS queue.

It doesn’t encrypt the following components:

  • Queue metadata (queue name and attributes)
  • Message metadata (message ID, timestamp, and attributes)
  • Per-queue metrics

Give it a try!

Amazon AppStream 2.0

appstream4

Have you ever had dream of using your desktop application from anywhere you want to, like running it from browser or from your proffered device? Well then your dream has already came true.

Amazon AppStream 2.0 is a fully managed, secure application streaming service that allows you to stream desktop applications from AWS to any device running a web browser, without rewriting them.

Though desktop application are meant to be used on desktop but today people want this to be used from anywhere and from their preferred device.

It is possible but to achieve this,organizations need to maintain multiple versions of their desktop applications, and take additional measures to secure applications and data.

So orgnaization either needs to modify their application in such a way that it runs on browser or continue to maintain and support complex desktop applications.

Amazon AppStream 2.0 comes as a savior here.

Below are some benefits of Amazon AppStream 2.0:

  • Native browser applications without the need to rewrite them
  • Run Desktop Applications on Any Device
  • A single version of each of your apps, which makes application management easier
  • Consistent, Scalable Performance
  • Secure Applications and Data
  • Instant-On Access

Amazon Appstream 2.0 currently allows you to try by yourself.

Below is the landing page when you open TryIt page:

appstream3

Then I selected Eclipse:

appstream1

appstream2

I was running Eclipse a few seconds later, no installation or setup needed:

It also allows you to set resolution as per your need and also allows you to work on full screen to give you experience as if you are working on your desktop application.

Below are few recently added features in Amazon AppStream 2.0:

Fleet Auto Scaling – This feature allows you to use the CloudWatch metrics to scale your fleet up and down in response to changes in demand. This allows you to deliver applications as economically as possible, while still providing instant access.

Image Builder – You can build your own AppStream 2.0 images that contain your choice of applications.

SAML 2.0 Authentication – You can use your existing SAML 2.0 compliant directory with AppStream 2.0. Your users can use their existing credentials to log in.

Fleet Management – You have additional management options for the instances that run your applications.

CloudWatch Metrics – You can observe and monitor seven Amazon CloudWatch metrics, including the size and overall utilization of your fleets.

Try it by yourself 🙂

New features in Amazon Quicksight

Amazon Quicksight now has some more cool features. Out of those, below are few features which I found very useful.

1) Export to CSV

amazon3

One of the most useful newly added feature is capability of exporting to CSV. This feature was requested by many people and finally Amazon Quicksight is equiped with export to CSV feature

You can now export your data to CSV by selecting the visual you want to export, clicking on the top-right menu icon, and choosing Export to CSV.

2) Possible connectivity with Microsoft Active Directory

amazonBy this feature, you can now connect Quicksight with your on promise AD using Quicksight AD connector. AD connector acts as a proxy which sends the credentials which have been entered for sign in to your on promise AD for validation purpose.

So now users who has their on promise AD credentials, can not log in into Quicksight using existing AD credentials.

Using Managed Microsoft AD, you can easily provision users across multiple cloud and on-premises domains using trust relationships provisioned with the respective ADs.

3) Aggregate filters for SPICE data sets

amazon2

With this feature, you can now put different aggregate filters for SPICE data sets. For example from your data set you want to figure out how many customers has bill amount more than 20k per month.

Apart from this, Quicksight also added some features like KPI charts by which you can present a single aggregated value from a measure, and also comparisons against another measure or over a time period and Custom ranges for Microsoft Excel spreadsheets which automatically detects the cell range of your table in the sheet when you upload an Excel spreadsheet.

To learn more about Quicksight, have a look here.

Insight of Amazon QuickSight

quick5

AWS has launched QuickSight in November 2016 and in very short period of time it became so popular.

First of we will see what is QuickSight?

Amazon QuickSight is a fast, cloud-powered business analytics service that makes it easy to build visualizations, perform ad-hoc analysis, and quickly get business insights from your data. Using our cloud-based service you can easily connect to your data, perform advanced analysis, and create stunning visualizations and rich dashboards that can be accessed from any browser or mobile device.

So in a single line we can say QuickSight is a cloud-powered, business analytics service that lets you quickly and easily visualize your data.

Okay, so you might be wondering what are top most benefits of using AWS QuickSight?

  • It is fast, and faster as well
  • It is easy to use
  • Most importantly it is 1/10th the cost of traditional BI solutions

Interesting right? Now you want to know what would be the best features AWS QuickSight provides?

Here they are:

  • You can choose your data source:

When you log in, Amazon QuickSight seamlessly discovers your data sources in AWS services such as Amazon Redshift, Amazon RDS, Amazon Athena, and Amazon Simple Storage Service (Amazon S3). You can connect to any of the data sources discovered by Amazon QuickSight and get insights from this data in minutes

quick1

  • SPICE – The Super-fast, Parallel, In-memory, Calculation Engine

Amazon QuickSight is built with “SPICE” – a Super-fast, Parallel, In-memory Calculation Engine. SPICE supports rich calculations that help customers derive valuable insights from their analysis without ever having to worry about provisioning or managing infrastructure. Importing your data into SPICE speeds your analytical queries by allowing you to take advantage of its storage and processing capacity. Data in SPICE is persisted until it is explicitly deleted by the user.

  • It is mobile friendly

The iPhone app for Amazon QuickSight lets you access your data anywhere, and explore analyses, stories, and dashboards. Look for Android and tablet support, as well as viewing and creating annotations in offline mode in the future.

quick2

  • It has Smart Visualizations

Amazon QuickSight supports a growing list of visual types including bar charts, heat and tree maps, pivot tables, and others.

It supports:

  • Comparison and distribution
    • Bar charts (several assorted variants)
  • Changes over time
    • Line graphs
    • Area line charts
  • Correlation
    • Scatter plots
    • Heat maps
  • Aggregation
    • Pie graphs
    • Tree maps
  • Tabular
    • Pivot tables

quick3

So finally we will see how it works?

quick4

Now just sign up to Amazon Quicksight and get 1 user and 1GB of SPICE capacity for free. That is the best part here 😉

Happy coding!