Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AddAzureSqlServer with RunAsContainer tries to provision roles when running locally #9422

@WolfspiritM

Description

@WolfspiritM

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In some cases when using AddAzureSqlServer together with RunAsContainer it tries to provision the sql-roles even so it should only run locally.

Image

Expected Behavior

No "sql-roles" should be published when running locally with "RunAsContainer"

Steps To Reproduce

  1. Create starter app template
  2. Add the Azure Sql nuget packet
  3. Add this to the AppHost builder:
builder.AddBicepTemplateString("test", "");

var sqlServer = builder
    .AddAzureSqlServer("sql")
    .RunAsContainer();
var identityDb = sqlServer.AddDatabase("identityDb");
  1. Add a "WithReference(identityDb)" to any of the projects.

Starting the project like this tries to publish sql roles.
This problem disappears if "AddBicepTemplate" or "AddBicepTemplateString" is removed or the reference to the database is removed.

Exceptions (if any)

No response

.NET Version info

.NET SDK:
Version: 9.0.300
Commit: 15606fe0a8
Workload version: 9.0.300-manifests.af4147de
MSBuild version: 17.14.5+edd3bbf37

Anything else?

.NET Aspire version 9.3.0
VS 2022

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesazureIssues associated specifically with scenarios tied to using AzuresqlserverIssues related to SQLServer integrtions‼️regression-from-last-releaseThis used to work in an earlier version of Aspire and we broke it!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions