microsoft / microsoft/aspire

Azure SQL Image `2022-latest` does not support `json` column type

Open
#13,084 3 comments 1 reaction 0 assignees View on GitHub
area-integrations sqlserver
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

# Azure SQL Image `2022-latest` does not support `json` column type

## Issue
Since the .NET 10 is released, They announced that Azure SQL now supports `json` column type.

However, the current `Aspire.Hosting.Azure.Sql` nuget package produces `mcr.microsoft.com/mssql/server` docker image with `2022-latest` tag.

Which does not support `json` column type yet.

## Solution
According to the [document](https://learn.microsoft.com/ko-kr/sql/t-sql/data-types/json-data-type?view=sql-server-ver17), It supports from `2025-latest` tag.

We need to bump the nuget package to use image with `2025-latest` tag.

## Temporary solution
```cs
var database = builder
.AddAzureSqlServer("database")
.RunAsContainer(config =>
{
config.WithImageRegistry("mcr.microsoft.com")
config.WithImage("mssql/server", "2025-latest")
});
```

## Related
- [What's New in EF Core 10 - Microsoft/learn](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-10.0/whatsnew)
- [JSON data type - Microsoft/learn](https://learn.microsoft.com/en-us/sql/t-sql/data-types/json-data-type?view=sql-server-ver17)

### Expected Behavior
The `Aspire.Hosting.Azure.Sql` nuget package should use `mcr.microsoft.com/mssql/server:2025-latest` image to support `json` column type.

### Steps To Reproduce
1. Create a new project using `Aspire.Hosting.Azure.Sql` nuget package.
2. Define an entity with `json` column type.
3. Create a migration using `dotnet ef migrations add ` command.
4. Run the migration using `dotnet ef database update` command.

### Exceptions (if any)
Exception message indicating that `json` column type is not supported.

### .NET Version info
- .NET 10

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.