diff --git a/cli/azd/pkg/project/resources.go b/cli/azd/pkg/project/resources.go index cd468eec9ce..2ef62e5875e 100644 --- a/cli/azd/pkg/project/resources.go +++ b/cli/azd/pkg/project/resources.go @@ -106,11 +106,41 @@ func (r *ResourceConfig) MarshalYAML() (interface{}, error) { if err != nil { return nil, err } + case ResourceTypeDbPostgres: + err := marshalRawProps(raw.Props.(PostgresProps)) + if err != nil { + return nil, err + } case ResourceTypeDbMySQL: err := marshalRawProps(raw.Props.(MySQLProps)) if err != nil { return nil, err } + case ResourceTypeDbMongo: + err := marshalRawProps(raw.Props.(MongoDBProps)) + if err != nil { + return nil, err + } + case ResourceTypeDbCosmos: + err := marshalRawProps(raw.Props.(CosmosDBProps)) + if err != nil { + return nil, err + } + case ResourceTypeMessagingServiceBus: + err := marshalRawProps(raw.Props.(ServiceBusProps)) + if err != nil { + return nil, err + } + case ResourceTypeMessagingEventHubs: + err := marshalRawProps(raw.Props.(EventHubsProps)) + if err != nil { + return nil, err + } + case ResourceTypeMessagingKafka: + err := marshalRawProps(raw.Props.(KafkaProps)) + if err != nil { + return nil, err + } } return raw, nil diff --git a/cli/azd/pkg/project/scaffold_gen.go b/cli/azd/pkg/project/scaffold_gen.go index a2e1aa99853..e1c5728b379 100644 --- a/cli/azd/pkg/project/scaffold_gen.go +++ b/cli/azd/pkg/project/scaffold_gen.go @@ -141,7 +141,7 @@ func infraSpec(projectConfig *ProjectConfig) (*scaffold.InfraSpec, error) { infraSpec.DbRedis = &scaffold.DatabaseRedis{} case ResourceTypeDbMongo: infraSpec.DbCosmosMongo = &scaffold.DatabaseCosmosMongo{ - DatabaseName: res.Props.(CosmosDBProps).DatabaseName, + DatabaseName: res.Props.(MongoDBProps).DatabaseName, } case ResourceTypeDbPostgres: infraSpec.DbPostgres = &scaffold.DatabasePostgres{