Saturday, February 15, 2025
HomeC#SQL Server Challenges – blogs.cninnovation.com

SQL Server Challenges – blogs.cninnovation.com


For the previous few weeks, I’ve been utilizing a Floor Laptop computer 7 with a Snapdragon ARM64 CPU as my predominant growth machine. This machine boasts wonderful battery life, and I respect the built-in Copilot, which leverages the NPU for enhanced efficiency in some purposes. I even have thrilling plans to make the most of Microsoft Recall as soon as it’s accessible once more.

On this article, I’ll share some essential concerns and my experiences utilizing an ARM machine for growth, notably with Visible Studio, SQL Server, Docker, and extra.

Utilizing Visible Studio

Visible Studio 2022, ranging from model 17.4, gives full native assist for ARM64. Presently, I’m utilizing model 17.12.0 Preview 4.0, alongside the launched model 17.11.5. Visible Studio runs exceptionally nicely on this machine. Nonetheless, there are a couple of exceptions price noting.

Utilizing SQL Server

SQL Server is essential for a lot of initiatives constructed by my shoppers. SQL Server LocalDb comes preinstalled with Visible Studio:

LocalDB installed with Visual Studio

Nonetheless, utilizing the ARM CPU, LocalDB doesn’t run.

Trying to put in SQL Server Developer version with the command:

winget set up Microsoft.SQLServer.2022.Developer

outcomes on this error:

Oops...
   
Unable to put in SQL Server (setup.exe).

      Exit code (Decimal): -2147467259
      Error description: Unknown error (0xe0000235)

  SQL SERVER INSTALL LOG FOLDER
      C:Program FilesMicrosoft SQL Server160Setup BootstrapLog20241027_113018

Installer failed with exit code: 2147500037

The detailed error log signifies:

ExecuteActionWithRetryHelper.Failed actionToExecute is 'SqlEngineConfigAction_install_confignonrc_Cpu64', stack hint    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.c__DisplayClass2_1.b__0()

The basis trigger is the ARM CPU. Based on SQL Server 2022: {Hardware} and software program necessities:

> Set up of SQL Server is supported on x64 processors solely. It isn’t longer supported on x86 processors.

It seems that the set up applications for SQL Server aren’t suitable with ARM CPUs.

Apparently, some customers had success working SQL Server on Home windows 11 on ARM with the assistance of this repo: MSSQLExpress-M1-Set up.some Reddit customers had success on working SQL Server for Home windows 11 on ARM!

My subsequent possibility was Azure SQL Edge. The documentation What’s Azure SQL Edge for this nice product lists this:

> Azure SQL Edge shall be retired on September 30, 2025.

I attempt to not use merchandise that shall be retired quickly. Nonetheless, on this case it might have been my alternative. Till that point we most likely have assist for ARM64 with SQL Server.

However on this case, there’s one other essential observe:

> Azure SQL Edge now not helps the ARM64 platform.

Switching over to the following possibility.

Utilizing Docker

Docker Desktop now gives set up choices for numerous platforms:

  • Obtain for Mac – Intel Chip
  • Obtain for Mac – Apple Silicon
  • Obtain for Home windows – AMD64
  • Obtain for Home windows – ARM64
  • Obtain for Linux

I already had Docker Desktop put in on my Floor Laptop computer 7. In my e book, Pragmatic Microservices with C# and Azure, Chapter 5 covers utilizing Docker to run the pattern answer with Docker containers. The app mannequin makes use of the .NET Aspire SQL Server Entity Framework Core integration:

var sqlServer = builder.AddSqlServer("sql", sqlPassword)
    .WithDataVolume("codebreaker-sql-data", isReadOnly: false)
    .AddDatabase("CodebreakerSql");

var gameAPIs = builder.AddProject("gameapis")
    .WithReference(sqlServer);

builder.AddProject("bot")
    .WithReference(gameAPIs);

Nonetheless, working the answer on the ARM CPU fails:

.NET Aspire dashboard with SQL Server on ARM

The logs present this error when beginning the container:

/decide/mssql/bin/sqlservr: Invalid mapping of tackle 0x2aaaad74d000 in reserved tackle house under 0x400000000000. Doable causes:
 1) the method (itself, or through a wrapper) starts-up its personal working atmosphere units the stack dimension restrict to limitless through syscall setrlimit(2);
 2) the method (itself, or through a wrapper) adjusts its personal execution area and flag the system its legacy character through syscall character(2);
 3) sysadmin intentionally units the system to run on legacy VA structure mode by adjusting a sysctl knob vm.legacy_va_layout.

A previous warning gives one other clue:

WARNING: The requested picture's platform (linux/amd64) doesn't match the detected host platform (linux/arm64/v8) and no particular platform was requested

You should utilize the docker examine command to get details about the downloaded picture:

docker examine mcr.microsoft.com/mssql/server:2022-latest

The outcomes present the structure:

  "Structure": "amd64",
  "Os": "linux",
  "Dimension": 578241111,

Trying to drag a Docker picture with the platform possibility set:

docker pull mcr.microsoft.com/mssql/server:2022-latest --platform linux/arm64/v8

nonetheless pulls the picture for amd64, because the picture for the platform linux/arm64/v8 just isn’t accessible presently.

You possibly can talk about the Docker picture for SQL Server within the MSSQL-Docker repo, the place these points are tracked:

which isn’t resolved but.

> As a sidenote, Docker requires an working system as its core, which additionally makes use of a CPU. Utilizing WASI, an working system just isn’t wanted, only a WASM runtime. With .NET 10, experimental WASI continues.

Switching over to the following possibility.

Utilizing Azure SQL

Utilizing Azure SQL is my subsequent possibility. It’s easy to make use of Azure SQL for native growth. Nonetheless, I encountered a difficulty impartial of the ARM CPU at a buyer web site the place the community used IPv6 to entry the Web. Though I can configure an IPv6 firewall rule with the Azure CLI:

az sql server ipv6-firewall-rule

IPv6 is disabled with Azure SQL server assets presently.

A technique round that is to make use of a digital community:

IPv6 for Azure Digital Community is usually accessible

You can even verify the Azure companies the place IPv6 might be configured.

As a substitute of configuring a digital community for IPv6 assist, I’ve been utilizing my Intel-based Floor machine to make use of SQL database.

Utilizing a number of techniques

Because the COVID-19 pandemic, when trainings moved on-line, I’ve discovered it useful to make use of not solely a number of screens but additionally two techniques. This setup permits me to maintain the attendees in view on one system whereas sharing my display on the opposite. Moreover, I’ve used Home windows Insider builds on one system whereas working a launched Home windows model on the opposite. This strategy additionally gives a backup in case the {hardware} of 1 machine fails. Presently, I’m utilizing an ARM64 CPU on one machine and an Intel CPU on the opposite.

This atmosphere has been notably useful, permitting me to modify to the Intel machine when utilizing the SQL database on the native system.

Extra points with Floor Laptop computer 7 with ARM processor

shall be added right here:

> Utilizing Paint with Copilot, the Floor Pen can’t be used.

Takeaway

The Floor Laptop computer seventh Version, that includes the Snapdragon ARM processor and built-in Copilot, is a incredible machine. Nonetheless, earlier than making it your main machine, make sure that the purposes and Docker pictures you depend on are suitable.

I personal two wonderful Floor gadgets, one with an Intel CPU and the opposite with an ARM CPU, and I’m excited in regards to the growing assist for ARM. As of now, SQL Server (together with its Docker picture) and the Floor Pen aren’t accessible for ARM.

What purposes do you employ that don’t assist the ARM CPU? Do you already personal a Home windows machine with an ARM64 processor? What’s your expertise with the purposes you employ

Take pleasure in studying and programming!

Christian

For those who like this text, please assist me with a espresso. Thanks!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments