aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Scenario: Ability to run as a container locally and deploy a connecting to an existing resource via a connection string

Open davidfowl opened this issue 1 year ago • 2 comments

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

davidfowl avatar Jan 22 '24 20:01 davidfowl

@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 avatar May 13 '24 10:05 mitchdenny

@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.

balachir avatar May 13 '24 18:05 balachir

Closing this scenario down. I think this is well tested now :)

mitchdenny avatar Sep 19 '24 07:09 mitchdenny