diff --git a/samples/manage/README.md b/samples/manage/README.md index 4e5d5265..db99eedb 100644 --- a/samples/manage/README.md +++ b/samples/manage/README.md @@ -2,16 +2,16 @@ Contains samples for managing Microsoft's SQL databases including SQL Server, Azure SQL Database, and Azure SQL Data Warehouse. -Samples are coming soon! - - ## Collect and monitor resource usage data across multiple pools in a subscription -This Solution Quick Start provides a solution for collecting and monitoring Azure SQL Database resource usage accross multiple pools in a subscription. When you have a large number of databases in a subscription, it is cumbersome to monitor each elastic pool separately. To solve this, you can combine SQL database PowerShell cmdlets and T-SQL queries to collect resource usage data from multiple pools and their databases for monitoring and analysis of resource usage. +This Solution Quick Start provides a solution for collecting and monitoring Azure SQL Database resource usage across multiple pools in a subscription. When you have a large number of databases in a subscription, it is cumbersome to monitor each elastic pool separately. To solve this, you can combine SQL database PowerShell cmdlets and T-SQL queries to collect resource usage data from multiple pools and their databases for monitoring and analysis of resource usage. [Manage Mulitiple Elastic Pools in SQL Database Using PowerShell and Power BI](https://github.com/Microsoft/sql-server-samples/tree/master/samples/manage/azure-sql-db-elastic-pools) in the GitHub SQL Server samples repository provides a set of powershell scripts and T-SQL queries along with documentation on what it does and how to use it. ## Get started using Elastic Pools in a SaaS scenario - This Solution Quick Start provides a solution for a Softwware-as-a-Solution (SaaS) scenario that leverages Elastic Pools to provide a cost-effective, scalable database back-end of a SaaS application. In this solution, you will walk-though the implementation of a web app that lets you visualize the load created on an Elastic Pool by a load generator using a custom dashboard that supplements the Azure Portal. [saas-scenario-with-elastic-pools](https://github.com/Microsoft/sql-server-samples/tree/master/samples/manage/azure-sql-db-elastic-pools-custom-dashboard) in the GitHub SQL Server samples repository provides a load generator and monitoring web app along with the documentation on what it does and how to use it. + +## Windows Containers +This includes samples for setting up mssql-server in Windows Containers. Currently it includes the following: +- __[windows-containers] (windows-containers /)__ diff --git a/samples/manage/windows-containers/mssql-server-2014-express-windows/dockerfile b/samples/manage/windows-containers/mssql-server-2014-express-windows/dockerfile new file mode 100644 index 00000000..df3f4849 --- /dev/null +++ b/samples/manage/windows-containers/mssql-server-2014-express-windows/dockerfile @@ -0,0 +1,30 @@ +# mssql server 2014 express image listening on static port 1433 +# +# Note: This dockerfile is based on Buc Rogers' work here: +# https://github.com/brogersyh/Dockerfiles-for-windows/tree/master/sqlexpress +# +# .NET 3.5 required for SQL Server +FROM microsoft/dotnet35 + +# maintainer for image metadata +MAINTAINER Perry Skountrianos + +# set environment variables +ENV SQL_EXPRESS_DOWNLOAD_URL "https://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x64/SQLEXPR_x64_ENU.exe" +ENV SQL_SERVER_SA_PASSWORD "Password1" + +# set working directory +WORKDIR / + +# download and install Microsoft SQL 2014 Express Edition in one step +RUN powershell -Command (New-Object System.Net.WebClient).DownloadFile('%SQL_EXPRESS_DOWNLOAD_URL%', 'sqlexpress.exe') && /sqlexpress.exe /qs /x:setup && /setup/setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SECURITYMODE=SQL /SAPWD=%SQL_SERVER_SA_PASSWORD% /SQLSVCACCOUNT="NT AUTHORITY\System" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS && del /F /Q sqlexpress.exe && rd /q /s setup + +RUN powershell -Command \ + set-strictmode -version latest ; \ + stop-service MSSQL`$SQLEXPRESS ; \ + set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql12.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value '' ; \ + set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql12.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433 ; \ + start-service MSSQL`$SQLEXPRESS + +CMD powershell -Command while ($true) { Start-Sleep -Seconds 3600 } +EXPOSE 1433 \ No newline at end of file diff --git a/samples/manage/windows-containers/mssql-server-2014-express-windows/readme.md b/samples/manage/windows-containers/mssql-server-2014-express-windows/readme.md new file mode 100644 index 00000000..644fd46c --- /dev/null +++ b/samples/manage/windows-containers/mssql-server-2014-express-windows/readme.md @@ -0,0 +1,67 @@ +# IoT Smart Grid +The goal of this Dockerfile is to help developers get started using SQL Server 2014 Express in Windows Containers. The Dockerfile downloads and installs SQL Server 2014 Express with the default setup parameters that could be changed (if needed) after the image is installed. + +Note: This dockerfile is based on Buc Rogers' work that can be found [here] (https://github.com/brogersyh/Dockerfiles-for-windows/tree/master/sqlexpress) + +### Contents + +[About this sample](#about-this-sample)
+[Before you begin](#before-you-begin)
+[Run this sample](#run-this-sample)
+[Sample details](#sample-details)
+[Disclaimers](#disclaimers)
+[Related links](#related-links)
+ + + +## About this sample + +1. **Applies to:** SQL Server 2014 Express, Windows Server Technical Preview 4 or later +5. **Authors:** Perry Skountrianos [perrysk-msft] + + + +## Before you begin + +To run this sample, you need the following prerequisites. + +**Software prerequisites:** + +1. System running Windows Server Technical Preview 4 or later. +2. 10GB available storage for container host image, OS Base Image and setup scripts. +3. Administrator permissions on the system. + + + +## Run this sample +Use the Dockerfile and execute the following two commands to build and run sqlexpress: +1. docker build -t sqlexpress . +2. docker run -it -p 1433:1433 sqlexpress cmd + + + +## Sample details + +**High Level Description** +The Dockerfile downloads and installs SQL Server 2014 Express with the following default setup parameters that could be changed (if needed) after the image is installed. +- sa password: Password1 +- Collation: SQL_Latin1_General_CP1_CI_AS +- SQL Instance Name: SQLEXPRESS +- Root Directory: C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL +- Language: English (United Stated) + + + +## Disclaimers +The code included in this sample is not intended to be a set of best practices on how to build scalable enterprise grade applications. This is beyond the scope of this quick start sample. + + + +## Related Links + + +For more information, see these articles: +- [Windows Containers] (https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/about_overview) +- [Windows-based containers: Modern app development with enterprise-grade control] (https://www.youtube.com/watch?v=Ryx3o0rD5lY&feature=youtu.be) +- [Windows Containers: What, Why and How] (https://channel9.msdn.com/Events/Build/2015/2-704) +- [SQL Server in Windows Containers] (https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/03/21/sql-server-in-windows-containers/#comments) diff --git a/samples/manage/windows-containers/readme.md b/samples/manage/windows-containers/readme.md new file mode 100644 index 00000000..31df6106 --- /dev/null +++ b/samples/manage/windows-containers/readme.md @@ -0,0 +1,3 @@ +## Windows Containers +This includes samples for setting up mssql-server in Windows Containers. Currently it includes the following: +- __[mssql-server-2014-express-windows] (mssql-server-2014-express-windows /)__