SQL Server 2022 Web
Videos
Overview: SQL Server 2022 Web on Azure: overview (watch on YouTube)
Launch and log in: SQL Server 2022 Web on Azure: launch and log in (watch on YouTube)
Deep Dive: SQL Server 2022 Web on Azure: deep dive (watch on YouTube)
Overview
SQL Server 2022 is Microsoft's relational database engine. Web is its edition for public, Internet-accessible web pages, sites, applications and services. It is the full database engine within Microsoft's Web edition limits: the lesser of 4 sockets or 16 cores, and 64 GB of buffer-pool memory (see Microsoft's SQL Server 2022 editions and features).
This guide covers deploying and using SQL Server 2022 Web from SecureAnyCloud on Ubuntu 22.04 on Microsoft Azure. The instance reports itself as Web Edition (64-bit). SQL Server 2022 adds ledger tables, contained availability groups, Query Store hints, parameter-sensitive plan optimization and new T-SQL functions such as JSON_OBJECT and JSON_ARRAY.
SPLA licensing. No SQL Server license is included in the price of this image. Web edition is licensed only through the Microsoft Services Provider License Agreement (see Licensing).
What you get:
- No shared, default or temporary password. The image ships SQL Server installed but not set up: there is no
masterdatabase, nosapassword and no machine key in the image. On your VM's first boot,mssql-firstboot.servicecreates a 32-charactersapassword on the VM and runs Microsoft's own unattended setup with it. It then writes the password to/root/mssql-credentials.txt(root only). No two VMs share a password, a certificate or an instance identity. - Port 1433 opens last. First boot sets SQL Server up on the loopback address only and checks it (edition, password, encryption, certificate) before it opens port 1433 on the VM's network interfaces. SQL Server never listens on the network with any password but your VM's own.
- Fail closed. SQL Server refuses to start until first boot has finished. If first boot cannot complete, SQL Server stays stopped and the next boot tries again.
- TLS on every connection. First boot creates the VM's own TLS key and self-signed certificate. SQL Server forces encryption (TLS 1.2) for every client, even one that does not ask for it.
- One login.
sais the only SQL login, with the password policy enforced. No default database or extra login is created. - No metadata access for the database. SQL Server and its first-boot service are blocked from the Azure Instance Metadata Service and the Azure wire server.
- Telemetry off (Microsoft's customer feedback program) and SQL Server Agent off.
xp_cmdshell, OLE Automation, CLR, ad hoc distributed queries and the remote admin connection are all disabled. - Fully patched Ubuntu 22.04 LTS at build time, with unattended security upgrades switched on.
What is on the image. SQL Server 2022 Web Edition 16.0.4305.5 (CU27 with the 2026-10-13 security update, KB5126934), mssql-tools18 (sqlcmd, bcp) and the Microsoft ODBC Driver 18 for SQL Server 18.7.1.1. All three come from Microsoft's official packages.microsoft.com repositories with the signing key pinned. The image also includes cloud-init and the Azure Linux Agent.
Default user: the admin user you choose (examples use azureuser). Architecture: x64, Gen2. Recommended size: Standard_D4s_v3 or larger.
Licensing
SQL Server 2022 Web edition is licensed only through the Microsoft Services Provider License Agreement (SPLA), for public and Internet-accessible web pages, websites, web applications and web services. No SQL Server license is included in this image and none is sold with it. The SecureAnyCloud charge covers the image, its hardening, first-boot setup, maintenance and support.
You need a SPLA agreement that covers the VM's cores, and the workload must be one that Web edition is licensed for. Your VM accepts the Microsoft Software License Terms on first boot and sets the edition with MSSQL_PID=Web, so there is no product key to enter. Direct licensing questions to Microsoft or your SPLA reseller.
Prerequisites
- An Azure subscription and a subscription to this offer in Azure Marketplace.
- An SSH public key or a password for the VM's admin user.
- A Microsoft SPLA agreement covering SQL Server 2022 Web for the VM's cores, as described under Licensing.
- A network security group that allows TCP 22 (SSH) from your admin network. Open TCP 1433 only if clients on other hosts must connect directly, and only from their addresses (Step 8).
Deploy the virtual machine from the Azure portal
In Azure Marketplace, search for SQL Server 2022 Web, select the SecureAnyCloud offer and choose Create.
On the Basics tab, choose your subscription, resource group and region, and name the VM. Choose Standard_D4s_v3 or larger (SQL Server needs at least 2 GB of memory) and set the administrator account. Under Inbound port rules, allow SSH (22) only.
On the Disks tab, choose Standard SSD or Premium SSD. SQL Server data lives in /var/opt/mssql/data on the OS disk.
On the Networking tab, keep or select a network security group that allows SSH from your admin network. Select Review + create, then Create.
Deploy the virtual machine from the Azure CLI
Accept the Marketplace terms once per subscription, then create the VM (replace the values in angle brackets):
az vm image terms accept --urn sac1647283583153:mssql-2022-web-ubuntu-22-04:default:latest
az vm create \
--resource-group <your-resource-group> \
--name sql-web-01 \
--image sac1647283583153:mssql-2022-web-ubuntu-22-04:default:latest \
--size Standard_D4s_v3 \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub \
--nsg-rule SSHFirst boot takes two to three minutes while SQL Server's setup creates the system databases. Until it finishes, systemctl is-active mssql-firstboot reports activating and /root/mssql-credentials.txt does not yet hold the real password. Later boots start SQL Server in seconds.
Connect and check the service
SSH to the VM:
ssh azureuser@<vm-public-ip>Check that the first-boot service and SQL Server both report active:
systemctl is-active mssql-firstboot mssql-serveractive activeCheck what is listening. Port 1433 is the database port, open on every interface (IPv4 0.0.0.0 and the dual-stack *). Port 1431 is an internal SQL Server port. Port 1434 is the local dedicated administrator connection (DAC), the emergency connection a sysadmin can use from the VM itself when SQL Server stops responding. Both stay on the loopback address, and remote DAC is off.
sudo ss -Htlnp | awk '{print $4, $6}' | sed 's/,pid=[0-9]*,fd=[0-9]*//g' | sort -u*:1433 users:(("sqlservr")) 0.0.0.0:1433 users:(("sqlservr")) 0.0.0.0:22 users:(("sshd")) 127.0.0.1:1431 users:(("sqlservr")) 127.0.0.1:1434 users:(("sqlservr")) 127.0.0.53%lo:53 users:(("systemd-resolve")) [::1]:1431 users:(("sqlservr")) [::1]:1434 users:(("sqlservr")) [::]:22 users:(("sshd"))Get your sa password
Only root can read the credentials file. List the setting names it holds:
sudo ls -l /root/mssql-credentials.txt
sudo grep -oE '^[A-Z_0-9]+=' /root/mssql-credentials.txt-rw------- 1 root root 1170 Oct 23 15:24 /root/mssql-credentials.txt SA_USER= SA_PASSWORD= <set-at-first-boot>= SQL_ENDPOINT_PRIVATE= SQL_EDITION= TLS_CERT= TLS_CERT_SHA256=Read the whole file with sudo cat /root/mssql-credentials.txt and store the password in your password manager. The password is unique to this VM.
Never pass the password to sqlcmd with -P, because it would land in your shell history and the process list. sqlcmd reads the password from the SQLCMDPASSWORD environment variable instead. Load it once per shell:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)"The blocks below repeat that line so that each one works on its own. sqlcmd is on the PATH of every login shell (/opt/mssql-tools18/bin), but the blocks use the full path.
Connect with sqlcmd
This command connects over the loopback address. The -C flag tells sqlcmd to trust the VM's self-signed certificate (Step 6 shows how to verify it instead).
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -Q "SET NOCOUNT ON; SELECT CAST(SERVERPROPERTY('Edition') AS nvarchar(40)) AS edition, CAST(SERVERPROPERTY('ProductVersion') AS nvarchar(20)) AS version, CAST(SERVERPROPERTY('ProductUpdateLevel') AS nvarchar(10)) AS cu, CAST(SERVERPROPERTY('EngineEdition') AS int) AS engine_edition"edition version cu engine_edition ---------------------------------------- -------------------- ---------- -------------- Web Edition (64-bit) 16.0.4305.5 CU27 2An engine_edition of 2 is the Standard engine, which Web edition runs.
Confirm the connection is encrypted
SQL Server forces encryption, so even a client that asks only for optional encryption (-No) gets an encrypted session. Check the session:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -No -Q "SET NOCOUNT ON; SELECT encrypt_option, protocol_type, auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@SPID"encrypt_option protocol_type auth_scheme ---------------------------------------- ---------------------------------------- ---------------------------------------- TRUE TSQL SQLThe certificate is this VM's own, named after its hostname (the VM name) and addresses. Inspect it, as in this example:
openssl x509 -in /etc/ssl/mssql/mssql.pem -noout -subject -enddate -ext subjectAltName -fingerprint -sha256subject=CN = mssql-web-2204-simA-10231437-c1a604 notAfter=Oct 20 15:21:18 2036 GMT X509v3 Subject Alternative Name: DNS:mssql-web-2204-simA-10231437-c1a604, DNS:localhost, IP Address:127.0.0.1, IP Address:10.0.0.12 sha256 Fingerprint=52:A6:F6:A8:99:AC:90:3F:8D:5D:29:D4:D3:77:CF:EE:91:F3:DC:FB:10:82:CC:A7:29:47:37:B1:CF:5C:ED:97The same fingerprint is in /root/mssql-credentials.txt as TLS_CERT_SHA256. To verify the server instead of trusting it blindly, make the certificate the client's trusted certificate and drop -C. A client without the certificate refuses the self-signed certificate. With it, full verification passes:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" SSL_CERT_FILE=/etc/ssl/mssql/mssql.pem /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -F "$(hostname)" -h -1 -Q "SET NOCOUNT ON; SELECT N'verified: ' + CAST(SERVERPROPERTY('ServerName') AS nvarchar(64))"verified: mssql-web-2204-simA-10231437-c1a604On your workstation, copy /etc/ssl/mssql/mssql.pem (the public certificate, never mssql.key) and add it to the client's trusted certificates. In tools that support it, you can pin the fingerprint instead.
Run SQL
Create a database, write a row, read it back and drop the database:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; CREATE DATABASE demo; EXEC('USE demo; CREATE TABLE dbo.notes (id INT IDENTITY PRIMARY KEY, body NVARCHAR(200) NOT NULL); INSERT INTO dbo.notes (body) VALUES (N''hello from SQL Server 2022 Web'');'); SELECT id, body FROM demo.dbo.notes; DROP DATABASE demo;"id body -- ---- 1 hello from SQL Server 2022 WebFor an application, create a dedicated login and database instead of using sa. Run the following in an interactive sqlcmd session (/opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C) and choose your own strong password:
CREATE DATABASE appdb; GO CREATE LOGIN appuser WITH PASSWORD = N'<a-strong-password>', CHECK_POLICY = ON; GO USE appdb; CREATE USER appuser FOR LOGIN appuser; ALTER ROLE db_owner ADD MEMBER appuser; GOConnect from other hosts
SQL Server listens on port 1433 on the VM's network interfaces with encryption forced. A client on another host can connect once your network security group allows it. Allow TCP 1433 only from the addresses that need it, never from Internet or *:
az network nsg rule create --resource-group <your-resource-group> --nsg-name <your-vm-nsg> \
--name allow-sql-from-app --priority 310 --access Allow --protocol Tcp --direction Inbound \
--source-address-prefixes <client-ip-or-cidr> --destination-port-ranges 1433From the VM itself, confirm that the private address accepts an encrypted session:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S "$(hostname -I | awk '{print $1}'),1433" -U sa -C -No -h -1 -Q "SET NOCOUNT ON; SELECT CAST(client_net_address AS varchar(20)) + ' encrypted=' + CAST(encrypt_option AS varchar(5)) FROM sys.dm_exec_connections WHERE session_id = @@SPID"10.0.0.12 encrypted=TRUEConnect SQL Server Management Studio, Azure Data Studio, VS Code or your application to <vm-ip>,1433. Use SQL Server authentication as sa (or your application login) and set encryption to Mandatory. Either trust the server certificate or install mssql.pem as a trusted certificate (Step 6).
The certificate names the VM's hostname, localhost and its private address. A client that connects by another name must trust the certificate or use a certificate you issue for that name (mssql-conf set network.tlscert and network.tlskey, then restart).
To keep port 1433 closed to the network entirely, bind SQL Server to the loopback address and use an SSH tunnel (ssh -N -L 1433:127.0.0.1:1433 azureuser@<vm-public-ip>):
sudo /opt/mssql/bin/mssql-conf set network.ipaddress 127.0.0.1
sudo systemctl restart mssql-serverSecurity details
This check lists the logins and hardening settings as SQL Server reports them. It also shows that a wrong password is refused:
export SQLCMDPASSWORD="$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /root/mssql-credentials.txt)" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; SELECT name, CAST(is_policy_checked AS int) AS policy_checked, CAST(is_disabled AS int) AS disabled FROM sys.sql_logins WHERE name NOT LIKE N'##%' ORDER BY name" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -W -Q "SET NOCOUNT ON; SELECT name, CAST(value_in_use AS int) AS value_in_use FROM sys.configurations WHERE name IN (N'xp_cmdshell', N'clr enabled', N'Ole Automation Procedures', N'Ad Hoc Distributed Queries', N'remote admin connections') ORDER BY name" SQLCMDPASSWORD=<set-at-first-boot> /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -C -Q "SELECT 1" 2>&1 | head -1 || truename policy_checked disabled ---- -------------- -------- sa 1 0 name value_in_use ---- ------------ Ad Hoc Distributed Queries 0 clr enabled 0 Ole Automation Procedures 0 remote admin connections 0 xp_cmdshell 0 Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Login failed for user 'sa'..Check the network, TLS and telemetry settings and the metadata block on both services:
sudo /opt/mssql/bin/mssql-conf get network
sudo /opt/mssql/bin/mssql-conf get telemetry customerfeedback systemctl show -p IPAddressDeny mssql-server mssql-firstboottcpport : 1433 tlscert : /etc/ssl/mssql/mssql.pem tlskey : /etc/ssl/mssql/mssql.key tlsprotocols : 1.2 forceencryption : 1 customerfeedback : false IPAddressDeny=169.254.169.254/32 168.63.129.16/32 IPAddressDeny=169.254.169.254/32 168.63.129.16/32- First boot. The script
/usr/local/sbin/mssql-firstboot.shcreates the TLS key and certificate. It creates thesapassword in a root-only file in memory and runsmssql-conf -n setup accept-eulawithMSSQL_PID=Web, passing the password in the environment (never on a command line). While SQL Server is still on the loopback address, the script checks the edition and build, that a wrongsapassword is refused, that the connection is encrypted, that port 1433 serves the VM's own certificate and that the metadata service is unreachable. Only then does it open port 1433 on the network. It checks login, refusal and the certificate again over the VM's private address and writes the credentials file. Its log isjournalctl -u mssql-firstboot. - Start gate.
mssql-server.servicehas a drop-in,/etc/systemd/system/mssql-server.service.d/50-sac.conf. The drop-in blocks the metadata service and refuses to start before first boot has written/var/lib/sac/data/mssql-ready. - SSH.
/etc/ssh/sshd_config.d/00-sac.confturns off root login, empty passwords and X11 forwarding. Password or key login for your admin user follows the choice you made when you created the VM. - Data and logs. They live under
/var/opt/mssql(data/,log/errorlog). The configuration file is/var/opt/mssql/mssql.conf.
Maintenance
Updates. Ubuntu security updates install automatically. SQL Server cumulative and security updates come from Microsoft's repository, which the image already trusts. Install them when you are ready:
sudo apt-get update
sudo apt-get install --only-upgrade mssql-server mssql-tools18 msodbcsql18Backups. Back up to a local file, then copy it off the VM (for example to Azure Blob Storage):
sqlcmd -S 127.0.0.1 -U sa -C -Q "BACKUP DATABASE appdb TO DISK = N'/var/opt/mssql/data/appdb.bak' WITH CHECKSUM"Web edition does not support backup compression, so back up uncompressed and compress the copy if you need to. Take Azure disk snapshots as a second layer.
Change the sa password. Connect as sa and run ALTER LOGIN sa WITH PASSWORD = N'<new-password>';, then update /root/mssql-credentials.txt if you keep it.
Memory. Web edition uses at most 64 GB for the buffer pool. By default, SQL Server on Linux uses up to 80% of the VM's memory. To leave more for other software, set a limit and restart. For example, run sudo /opt/mssql/bin/mssql-conf set memory.memorylimitmb 4096, then sudo systemctl restart mssql-server.
SQL Server Agent. Web edition includes SQL Server Agent for scheduled jobs. It ships turned off. Turn it on when you need it:
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-serverLicenses when you resize. Web is licensed per core. If you move to a VM size with more vCPUs, make sure your SQL Server licenses cover it. SQL Server uses only the cores its edition allows.
Support
SecureAnyCloud provides 24/7 technical support for this image by email and live chat: sales@secureanycloud.com. SQL Server licensing questions go to Microsoft.
Microsoft, Azure and SQL Server are trademarks of the Microsoft group of companies. Ubuntu is a registered trademark of Canonical Ltd. SecureAnyCloud is not affiliated with or endorsed by Microsoft or Canonical.
Deploy on Azure
Launch SQL Server 2022 Web on Ubuntu 22.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Microsoft SQL Server 2022 Web Edition is the low-cost edition for public and internet-facing web applications and hosting. It has a reduced feature set and resource ceiling compared with Standard. This SecureAnyCloud image runs it on AWS as the only workload on the instance, so the platform stays lean and predictable.
This guide covers the Web delivery option. SQL Server 2022 is also offered in other editions on the same listing. See the SQL Server 2022 on AWS hub to compare and choose.
What you get:
- SQL Server installed from the official Microsoft APT repository
- The
mssql-tools18package and thesqlcmdcommand-line utility, preinstalled - A dedicated gp3 EBS volume mounted at
/var/opt/mssqlfor SQL Server data and log files, separate from the OS disk and independently resizable - A one-shot service on the first boot of your instance that creates a fresh SA password and a dedicated SecureAnyCloud SQL login, removes the build-time memory cap and writes all credentials to /root/mssql-credentials.txt, a file only root can read
- No shared or default credentials in the image
- SQL Server listening on port 1433 and starting on boot via systemd
Web edition at a glance: up to 16 cores and 64 GB of buffer-pool memory. It is licensed only for public web-facing applications and websites, not for internal line-of-business workloads.
This is a headless image. SQL Server has no web interface. You administer it over SSH with sqlcmd or any compatible SQL Server client on port 1433.
Prerequisites
Before you deploy this image, make sure you have:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group that allows inbound port 22 from your management network
- The AWS CLI (version 2) installed locally, if you plan to deploy from the command line
Recommended instance type: m5.large or m5.xlarge.
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for SQL Server 2022. Select the SecureAnyCloud listing and choose Select. On the subscription summary, pick the SQL Server 2022 Web on Ubuntu 22.04 delivery option and choose Continue.
Pick an instance type that suits your workload (see Prerequisites). Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet and a security group that allows inbound port 22 from your management network. Add port 1433 if you want external clients to connect to SQL Server directly. The AMI brings its own data volume, so leave the block device mappings at their defaults.
Select Launch instance. First-boot initialization generates the SA password and starts SQL Server. It takes a minute or two after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
Replace <ami-id> with the AMI ID shown on the Marketplace listing for the Web delivery option. Replace the other values in angle brackets with your own network and key details:
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.xlarge \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--metadata-options HttpTokens=required \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=mssql-01}]'The AMI defines the data volume, so you do not need to specify it. When the instance is running, retrieve its public address:
aws ec2 describe-instances --instance-ids <instance-id> \
--query "Reservations[].Instances[].PublicIpAddress" --output textConnect over SSH
Wait until the instance has passed both EC2 status checks, then connect over SSH. This delivery option is built on Ubuntu 22.04, so the login user is ubuntu:
ssh ubuntu@<your-instance-ip>Retrieve the SA password
The first-boot service writes the per-instance credentials to /root/mssql-credentials.txt (root-only). Read the file as root:
sudo cat /root/mssql-credentials.txtThe file looks like this. Your instance holds its own unique passwords:
# SQL Server 2022 Web Edition -- Per-Instance Credentials
# Generated: Wed Jun 04 09:00:00 UTC 2026
# SA_USER=sa SA_PASSWORD=<set-at-first-boot> SAC_USER=sac SAC_PASSWORD=<set-at-first-boot> SAC_DATABASE=sacThe SecureAnyCloud login has the db_owner role on the SecureAnyCloud database and is suitable for application connections.
Connect to SQL Server with sqlcmd
Read the SA password from the credentials file and open a sqlcmd session:
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -CThe -C flag trusts the self-signed server certificate. Type GO to run a batch and exit to quit.
Verify the version and edition
Query the server version:
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q "SELECT @@VERSION"The output resembles the following. The edition line reflects this image's Web edition:
Microsoft SQL Server 2022 (RTM-CU25) (KB5054531) - 16.0.4255.1 (X64) May 20 2026 12:06:45 Copyright (C) 2022 Microsoft Corporation Web Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS) <X64>Licensing
This image installs SQL Server Web Edition with evaluation licensing. To license it for production, stop the service, apply your 25-character product key and restart the service:
sudo systemctl stop mssql-server
sudo MSSQL_PID='<your-25-char-product-key>' /opt/mssql/bin/mssql-conf -n setup
sudo systemctl start mssql-serverAfterwards, confirm the edition with the SERVERPROPERTY('Edition') query in Step 6.
Check the SQL Server service
Check the service status:
sudo systemctl status mssql-server --no-pagerManage the service with sudo systemctl {stop,start,restart} mssql-server.
Review the data volume
SQL Server data and log files are stored on a dedicated gp3 EBS volume mounted at /var/opt/mssql, separate from the OS disk. Confirm the mount:
df -h /var/opt/mssql lsblkTo grow the volume, resize the EBS volume in the AWS console, then extend the filesystem on the instance:
sudo resize2fs $(findmnt -no SOURCE /var/opt/mssql)Create a database and table
Create a database, add a table and insert a row:
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q "IF DB_ID('myapp') IS NULL CREATE DATABASE [myapp];" /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -d myapp -Q "IF OBJECT_ID('customers') IS NULL CREATE TABLE customers (id INT IDENTITY PRIMARY KEY, name NVARCHAR(100), email NVARCHAR(200)); INSERT INTO customers (name,email) VALUES ('Alice Smith','alice@example.com'); SELECT id,name,email FROM customers;"Connect from a remote client
SQL Server listens on port 1433. Add port 1433 to the security group, then connect with SSMS, Azure Data Studio, DBeaver or sqlcmd:
/opt/mssql-tools18/bin/sqlcmd -S <your-instance-ip>,1433 -U sa -P "<SA_PASSWORD>" -CBack up a database
Create a backup directory and back up the SecureAnyCloud database to it:
sudo mkdir -p /var/opt/mssql/backup && sudo chown mssql:mssql /var/opt/mssql/backup
SA_PASS=$(sudo grep '^SA_PASSWORD=' /root/mssql-credentials.txt | cut -d= -f2-) /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U sa -P "${SA_PASS}" -C -Q \
"BACKUP DATABASE [sac] TO DISK = N'/var/opt/mssql/backup/sac.bak' WITH INIT, COMPRESSION;"Troubleshooting
- SQL Server will not start. Read
sudo cat /var/opt/mssql/log/errorlog | tail -50andsudo journalctl -u mssql-server -n 50 --no-pager. - Port 1433 is unreachable. Check the security group inbound rules.
- Credentials file permission denied. The file is root-only, so use
sudo. - First boot did not run. Read
sudo journalctl -u mssql-firstboot -n 50 --no-pagerandsudo cat /var/log/mssql-firstboot.log.
SecureAnyCloud Support
SecureAnyCloud supports this image. For help with SQL Server deployment, configuration, performance tuning, high availability or administration, contact sales@secureanycloud.com. Support is available 24 hours a day, 7 days a week.
Deploy on AWS
Launch SQL Server 2022 Web on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com