After deployment via 'azd up' the connection from my container apps to the Azure SQL database failed.
The SQL Server and the database are defined as follows in AppHost:
var travelLoungeMsSql =
builder
.ExecutionContext.IsPublishMode ?
builder
.AddSqlServer("travellounge-mssql")
.PublishAsAzureSqlDatabase() :
builder
.AddSqlServer("travellounge-mssql", password: msSqlPassword)
.WithBindMount("../../.containers/mssql", "/var/opt/mssql/data");
var travelLoungeMsSqlCatalog = travelLoungeMsSql
.AddDatabase("travellounge-mssql-catalog", "TravelLounge_Catalog");
Access to the database in the container app:
app.AddSqlServerDbContext<ApplicationDbContext>("travellounge-mssql-catalog", configureDbContextOptions: options =>
{
options.UseSqlServer(sqlOptions =>
{
sqlOptions.MigrationsAssembly(typeof(ApplicationDbContext).GetTypeInfo().Assembly.GetName().Name);
});
options.EnableSensitiveDataLogging();
});
The managed identity is assigned as Entra admin to the SQL server but I have no idea what is missing and why the connection fails.
Packages used:
-
"Aspire.Hosting.Azure" Version="8.0.1"
-
"Aspire.Hosting.Azure.Sql" Version="8.0.1"
-
"Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1"
After deployment via 'azd up' the connection from my container apps to the Azure SQL database failed.
The SQL Server and the database are defined as follows in AppHost:
Access to the database in the container app:
The managed identity is assigned as Entra admin to the SQL server but I have no idea what is missing and why the connection fails.
Packages used:
"Aspire.Hosting.Azure" Version="8.0.1"
"Aspire.Hosting.Azure.Sql" Version="8.0.1"
"Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1"