Skip to content

Azure PostgreSQL AsExisting doesn't deploy successfully #7694

@eerhardt

Description

@eerhardt

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using AddAzurePostgresFlexibleServer and AsExisting, the bicep we generate doesn't work. You get an error on startup:

pg.module.bicep(12,3) : Error BCP173: The property "properties" cannot be used in an existing resource declaration. [https://aka.ms/bicep/core-diagnostics#BCP173]

Expected Behavior

I expect to use an existing Azure PostgreSQL server in my app.

Steps To Reproduce

var serverName = "myserver";
var rg = "myresourcegroup";

var db = builder.AddAzurePostgresFlexibleServer("pg")
                .RunAsExisting(serverName , rg)
                .AddDatabase("db");

When you F5 you get the above error when it tries provisioning.

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

cc @captainsafia

Metadata

Metadata

Assignees

Labels

area-integrationsIssues pertaining to Aspire Integrations packagesazureIssues associated specifically with scenarios tied to using AzurepostgresIssues related to Postgres integrations

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions