I experimenting with.net 8 aspire currently.
I am following Microsoft documentation. I did a simple project with Backend api, frontend, and Redis cache.
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedisContainer("crediscache");
var weatherapi = builder.AddProject<Projects.WeatherApp_Api>("weatherapi");
builder.AddProject<Projects.WeatherApp_Web>("frontend")
.WithReference(weatherapi)
.WithReference(cache);
All works fine. By working fine I mean it can deploy everything on the local environment with a Redis container on the docker desktop and when I use the command line azd init, it creates the required infrastructure files and when I run azd up it deploys everything correctly on azure.
But when I AddSqlServerContainer like:
var database = builder.AddSqlServerContainer("database");
It creates the database on the docker desktop but, when I run azd init, it returns an error:
ERROR: unsupported resource type: sqlserver.server.v1
Is this because it is still in preview or is it an azd issue, or is it something wrong I am doing?
I use Visual Studio Enterprise 2022 Preview 17.9.0 Preview 1.0 with the latest azd version "azd version 1.5.0 (commit 012ae734904e0c376ce5074605a6d0d3f05789ee)"
It compiles fine, there are not code issue.
The issue is actually in azd. azd doesn't support the SqlServer resource type yet, the following azd GitHub issue is tracking implementation:
https://github.com/Azure/azure-dev/issues/3020