SlideShare a Scribd company logo
Deploy .Net application and SQL
server database on linux
environment
Ajith Ramawickrama
Chief Technology Officer
FinTechnology Asia Pasific.
Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux
Introduction
Microsoft has been working with Linux for a number of years in order
to facilitate their customers to run work loads in both Windows and
Linux platforms. Followings are the few achievements
Linux on your Datacenter – Hyper-V
Linux on Azure
.Net Core
Visual Studio Code – Official IDE for .Net core on Linux and OSX
SQL Server V-Next (Production release on mid 2017)
.Net Core
.Net Core is a cross platform, open source, general purpose , modular
application development framework developed by Microsoft. Unlike
other .Net framework, .Net core has built from the stretch using .Net
standards. It contains most of APIs as the .Net standard framework, but
.net core is a smaller set which includes runtime, framework, compiler
and tools components that support a variety of operating systems and
chip targets. .Net runs on Windows, Linux and OS-x operating systems.
.Net Core
Advantages of .Net core
Flexible deployment: Can be included in your app or installed side-by-side user- or
machine-wide.
Cross-platform: Runs on Windows, macOS and Linux
Command-line tools: All product scenarios can be exercised at the command-line.
Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET
Standard.
Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses.
 Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support
Runs on Docker.
Comes with inbuilt web server Kerstral
Supporting Linux Systems
Ubuntu – 14.04,16.04,16.10
Red Hat Enterprise Linux
Linux Mint -17,18
Debian 8
Fedora
CentOS 7.1
Oracle Linux 7.1
Open SUSE
Install .Net core on Ubuntu 16.04 LTS
1) Preparing the system for installation
In order to apt-get feed that hosts the package you need Run following commands in the
console one after another
• sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" >
/etc/apt/sources.list.d/dotnetdev.list'
• sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
• sudo apt-get update
2) Install .Net Code SDK
Run Following command in order to install .Net Core SDK
sudo apt-get install dotnet-dev-1.0.4
Deploy FinAp Formula in Ubuntu 16.04
There are two types of deployment options available in .Net core
1) Framework dependent deployment
 .Net core should be pre installed
 Size of the deployment package is very small
 Reduce the disk and memory usage of deployment server
2) Self contained deployment
 Create deployment package including all framework dependencies and other third party
dependencies
 No need to install .Net core on target server
 Need to set target platform at the time of deployment package creation
 Large deployment package
Framework dependent deployment
 Go to your solution folder in windows command prompt
 Run the command “dotnet restore” in order to make sure that all the dependencies are properly
restored
 Navigate to ASP.Net application(web or web api) folder and run the command “dotnet build” to
build the solution
 Run the command “dotnet publish -f netcoreapp1.1 -c Release” to create deployment package
 Copy created package to Ubuntu PC
 Go to the copied directory and run “dotnet executable-name.dll” in ubuntu terminal
SQL Server VNext
• SQL Server 2017 represents a major step towards making SQL Server
a platform that gives you choices of development languages, data
types, on-premises and in the cloud, and across operating systems by
bringing the power of SQL Server to Linux, Linux-based Docker
containers, and Windows.
• Newest version is SQL Server 2017 CTP 2.1. According to Microsoft
Production version to be released on mid 2017
• Currently Support Linux Versions
• Red Hat Enterprise Linux
• SUSE Linux Enterprise Server
• Ubuntu 16.04
• Docker Engine 1.8 +
Install SQL Server Vnext on Ubuntu 16.04
• Minimum System Requirements
• Memory- 3.25 GB
• File System- XFS or EXT4
• Disk Space - 1GB
• Processor Speed -1.4 Ghz
• Processor Cores – 2 cores
• Processor Type – X64 only
1) Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
2) Register the Microsoft SQL Server Ubuntu repository:
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee
/etc/apt/sources.list.d/mssql-server.list
3) Install SQL Server
sudo apt-get update
sudo apt-get install -y mssql-server
4) Config SQL Server
sudo /opt/mssql/bin/mssql-conf setup
5) Check the status
systemctl status mssql-server
Install SQL tools on Ubuntu
1) Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
Register the Microsoft Ubuntu repository.
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee
/etc/apt/sources.list.d/msprod.list
3) unixODBC developer package
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
4) Update MsSql tools
sudo apt-get update
sudo apt-get install mssql-tools
5) Set PATH variable
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
Restore SQL Server Backup On Ubuntu
• Take a backup of the database from Windows machine
• Transfer backup to Linux (VMWare Tools/PUTTY,SSH)
• Move the backup files to SQL directory
Enter Super user mode
sudo su
Create Backup Directory On /var/opt/mssql
mkdir -p /var/opt/mssql/backup
Move Backup files
mv /home/user1/AdventureWorks2014.bak
/var/opt/mssql/backup/
• Restore database
sqlcmd -S localhost -U SA
RESTORE DATABASE FinApCore
FROM DISK = '/var/opt/mssql/backup/backupName.bak'
WITH MOVE ‘FinApCore_Data' TO '/var/opt/mssql/data/FinapCore_Data.mdf',
MOVE ‘FinApCore_Log' TO '/var/opt/mssql/data/FinApCore_Log.ldf'
GO
Why we Need Reverse Proxy?
• Kestrel is the default web server for .net core which is serving
dynamic contents
• Reverse Proxy Allows Us to
• serving static content
• caching requests
• compressing requests
• SSL termination from the HTTP server
• IIS Works as the reverse proxy for windows and NginX or Apache
works as the reverse proxy for Linux
Thank You

More Related Content

PDF
Code Factory avec GitLab CI et Rancher
PPTX
Open stack implementation
PDF
L'affaire CentOS
PDF
How to integrate_custom_openstack_services_with_devstack
ODP
OpenStack DevStack Configuration localrc local.conf Tutorial
PDF
How to master OpenStack in 2 hours
PPT
Features supported by squid proxy server
PDF
Nelf2012
Code Factory avec GitLab CI et Rancher
Open stack implementation
L'affaire CentOS
How to integrate_custom_openstack_services_with_devstack
OpenStack DevStack Configuration localrc local.conf Tutorial
How to master OpenStack in 2 hours
Features supported by squid proxy server
Nelf2012

What's hot (20)

DOCX
final proposal-Xen based Hypervisor in a Box
PDF
Dev stacklabguide
PPTX
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
PPTX
DataDrivenMtl 20170906 - SQL Server 2017 on Linux
PDF
PDF
Scale13
PDF
Oracle linux kube
PDF
Introduction to FreeNAS development by John Hixson
PDF
PPTX
Helm @ Orchestructure
PPTX
Devops in Networking
PDF
Rancher Rodeo
ODP
LinuxKit Swarm Nodes
PDF
Docker security: Rolling out Trust in your container
PDF
Docker Security and Content Trust
PDF
Olf2017
PPTX
K8s security best practices
PPTX
Docker Container Security - A Network View
PPTX
DevStack
PPTX
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
final proposal-Xen based Hypervisor in a Box
Dev stacklabguide
OpenStack : DevStack installation using VirtualBox & Ubnutu (Juno with Neutron)
DataDrivenMtl 20170906 - SQL Server 2017 on Linux
Scale13
Oracle linux kube
Introduction to FreeNAS development by John Hixson
Helm @ Orchestructure
Devops in Networking
Rancher Rodeo
LinuxKit Swarm Nodes
Docker security: Rolling out Trust in your container
Docker Security and Content Trust
Olf2017
K8s security best practices
Docker Container Security - A Network View
DevStack
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
Ad

Similar to Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux (20)

PDF
AltNet fr talks #2016.11 - news
PPTX
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
PPTX
SQL Server vNext on Linux
PPTX
Nordic infrastructure Conference 2017 - SQL Server on Linux Overview
PPTX
SUSE Webinar - Introduction to SQL Server on Linux
PPTX
The Long Awaited Cloud Solution - Azure Stack Service and Use Case
PPTX
SQL Server 2017 on Linux Introduction
PPTX
SQL Server on Linux - march 2017
PPTX
SQL Server 2017 on Linux Introduction
PPTX
Flisol 2018 - Microsoft + Open Source
PDF
Microsoft SQL server 2017 Level 300 technical deck
PDF
SUSE Open Source Solutions on Azure and Azure Stack
PPTX
Experience sql server on l inux and docker
PPTX
Microsoft Really Loves Linux – a Virtual Love Story
PPTX
Tech-Spark: SQL Server on Linux
PPTX
Keynote Microsoft Azure Summit
PPTX
Brk2051 sql server on linux and docker
PDF
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
PPTX
Sql on linux - ITpro
PDF
Linux en microsoft azure global azure lima
AltNet fr talks #2016.11 - news
SUSE Expert Days, Brussels and Luxembourg - SUSE + Microsoft Partnership gets...
SQL Server vNext on Linux
Nordic infrastructure Conference 2017 - SQL Server on Linux Overview
SUSE Webinar - Introduction to SQL Server on Linux
The Long Awaited Cloud Solution - Azure Stack Service and Use Case
SQL Server 2017 on Linux Introduction
SQL Server on Linux - march 2017
SQL Server 2017 on Linux Introduction
Flisol 2018 - Microsoft + Open Source
Microsoft SQL server 2017 Level 300 technical deck
SUSE Open Source Solutions on Azure and Azure Stack
Experience sql server on l inux and docker
Microsoft Really Loves Linux – a Virtual Love Story
Tech-Spark: SQL Server on Linux
Keynote Microsoft Azure Summit
Brk2051 sql server on linux and docker
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
Sql on linux - ITpro
Linux en microsoft azure global azure lima
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ai tools demonstartion for schools and inter college
PPTX
Introduction to Artificial Intelligence
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Softaken Excel to vCard Converter Software.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Odoo Companies in India – Driving Business Transformation.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
L1 - Introduction to python Backend.pptx
Transform Your Business with a Software ERP System
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Reimagine Home Health with the Power of Agentic AI​
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Digital Strategies for Manufacturing Companies
Operating system designcfffgfgggggggvggggggggg
Understanding Forklifts - TECH EHS Solution
ai tools demonstartion for schools and inter college
Introduction to Artificial Intelligence
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Softaken Excel to vCard Converter Software.pdf

Install .Net Core, SQL Server V-Next on Linux and deploy .Net core application and sql server database on Linux

  • 1. Deploy .Net application and SQL server database on linux environment Ajith Ramawickrama Chief Technology Officer FinTechnology Asia Pasific.
  • 3. Introduction Microsoft has been working with Linux for a number of years in order to facilitate their customers to run work loads in both Windows and Linux platforms. Followings are the few achievements Linux on your Datacenter – Hyper-V Linux on Azure .Net Core Visual Studio Code – Official IDE for .Net core on Linux and OSX SQL Server V-Next (Production release on mid 2017)
  • 4. .Net Core .Net Core is a cross platform, open source, general purpose , modular application development framework developed by Microsoft. Unlike other .Net framework, .Net core has built from the stretch using .Net standards. It contains most of APIs as the .Net standard framework, but .net core is a smaller set which includes runtime, framework, compiler and tools components that support a variety of operating systems and chip targets. .Net runs on Windows, Linux and OS-x operating systems.
  • 6. Advantages of .Net core Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide. Cross-platform: Runs on Windows, macOS and Linux Command-line tools: All product scenarios can be exercised at the command-line. Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard. Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses.  Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support Runs on Docker. Comes with inbuilt web server Kerstral
  • 7. Supporting Linux Systems Ubuntu – 14.04,16.04,16.10 Red Hat Enterprise Linux Linux Mint -17,18 Debian 8 Fedora CentOS 7.1 Oracle Linux 7.1 Open SUSE
  • 8. Install .Net core on Ubuntu 16.04 LTS 1) Preparing the system for installation In order to apt-get feed that hosts the package you need Run following commands in the console one after another • sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' • sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 • sudo apt-get update 2) Install .Net Code SDK Run Following command in order to install .Net Core SDK sudo apt-get install dotnet-dev-1.0.4
  • 9. Deploy FinAp Formula in Ubuntu 16.04 There are two types of deployment options available in .Net core 1) Framework dependent deployment  .Net core should be pre installed  Size of the deployment package is very small  Reduce the disk and memory usage of deployment server 2) Self contained deployment  Create deployment package including all framework dependencies and other third party dependencies  No need to install .Net core on target server  Need to set target platform at the time of deployment package creation  Large deployment package
  • 10. Framework dependent deployment  Go to your solution folder in windows command prompt  Run the command “dotnet restore” in order to make sure that all the dependencies are properly restored  Navigate to ASP.Net application(web or web api) folder and run the command “dotnet build” to build the solution  Run the command “dotnet publish -f netcoreapp1.1 -c Release” to create deployment package  Copy created package to Ubuntu PC  Go to the copied directory and run “dotnet executable-name.dll” in ubuntu terminal
  • 11. SQL Server VNext • SQL Server 2017 represents a major step towards making SQL Server a platform that gives you choices of development languages, data types, on-premises and in the cloud, and across operating systems by bringing the power of SQL Server to Linux, Linux-based Docker containers, and Windows. • Newest version is SQL Server 2017 CTP 2.1. According to Microsoft Production version to be released on mid 2017 • Currently Support Linux Versions • Red Hat Enterprise Linux • SUSE Linux Enterprise Server • Ubuntu 16.04 • Docker Engine 1.8 +
  • 12. Install SQL Server Vnext on Ubuntu 16.04 • Minimum System Requirements • Memory- 3.25 GB • File System- XFS or EXT4 • Disk Space - 1GB • Processor Speed -1.4 Ghz • Processor Cores – 2 cores • Processor Type – X64 only
  • 13. 1) Import the public repository GPG keys curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - 2) Register the Microsoft SQL Server Ubuntu repository: curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list 3) Install SQL Server sudo apt-get update sudo apt-get install -y mssql-server 4) Config SQL Server sudo /opt/mssql/bin/mssql-conf setup 5) Check the status systemctl status mssql-server
  • 14. Install SQL tools on Ubuntu 1) Import the public repository GPG keys. curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add – Register the Microsoft Ubuntu repository. curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list 3) unixODBC developer package sudo apt-get update sudo apt-get install mssql-tools unixodbc-dev 4) Update MsSql tools sudo apt-get update sudo apt-get install mssql-tools 5) Set PATH variable echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc
  • 15. Restore SQL Server Backup On Ubuntu • Take a backup of the database from Windows machine • Transfer backup to Linux (VMWare Tools/PUTTY,SSH) • Move the backup files to SQL directory Enter Super user mode sudo su Create Backup Directory On /var/opt/mssql mkdir -p /var/opt/mssql/backup Move Backup files mv /home/user1/AdventureWorks2014.bak /var/opt/mssql/backup/
  • 16. • Restore database sqlcmd -S localhost -U SA RESTORE DATABASE FinApCore FROM DISK = '/var/opt/mssql/backup/backupName.bak' WITH MOVE ‘FinApCore_Data' TO '/var/opt/mssql/data/FinapCore_Data.mdf', MOVE ‘FinApCore_Log' TO '/var/opt/mssql/data/FinApCore_Log.ldf' GO
  • 17. Why we Need Reverse Proxy? • Kestrel is the default web server for .net core which is serving dynamic contents • Reverse Proxy Allows Us to • serving static content • caching requests • compressing requests • SSL termination from the HTTP server • IIS Works as the reverse proxy for windows and NginX or Apache works as the reverse proxy for Linux