aspire
aspire copied to clipboard
Scenario: Ability to run as a container locally and deploy a connecting to an existing resource via a connection string
e.g. Developing against a redis container and deploying a connection to an existing resource that needs to be specified at deployment time via a connection string.
Related https://github.com/dotnet/aspire/issues/1958
@balachir I think this should be working fine now but current status looks like it wasn't tested. I've verified that PublishAsConnectionString(...) extension works. I can see that it emits a connection string parameter into the manifest instead of a container resource:
"cache": {
"type": "parameter.v0",
"connectionString": "{cache.value}",
"value": "{cache.inputs.value}",
"inputs": {
"value": {
"type": "string",
"secret": true
}
}
},
... produced by C#:
var cache = builder.AddRedis("cache").PublishAsConnectionString();
@mitchdenny thanks for calling this out. I'll work with our validation team and see how we can improve our test coverage for this scenario.
Closing this scenario down. I think this is well tested now :)