How do I use a library set from a tenant project library?

We already have a library set with the connect strings to all of our database tenants. For example:
ConnStrTenantA = Data Source=#{TenantA Server}; …
ConnStrTenantB = Data Source=#{TenantB Server}; …
In this case, the tenant references to the database but we don’t deploy anything using Ocotpus Tenants. When we need one of these variables we directly use #{ConnStrTenantA} or #{ConnStrTenantb}.

Now I need to make my first Ocotpus Tenant project, and use these connect strings.
In my Ocotpus project, I included the library set and created a project template with a variable named ConnectionStrings:Default.
In my Octoptus Tenant for TenantA, under project variables, I set the ConnectionStrings:Default value to #{ConnStrTenantA}.

My thought was this would use the value for ConnStrTenantA in the library set, but it didn’t. Instead , I get “ConnectionStrings:Default.= #{ConnStrTenantA}” - there was no variable substitution.

Hello Don,

Thanks for reaching out!

Based on your description, I set up what I think is a matching scenario locally, and it’s working as expected. I want to share some screenshots of what I did to confirm that you’re doing the same thing.

First, I created my library set with the tenant specific db connection strings.

Next, I referenced that library set in my project.

Then I created a project template variable called ConnectionString:Default .

And finally, inside of my tenant, I provide the library set variable ConnStrA as the value for the template variable.

My deployment process for the project prints out the value of the ConnectionString:Default variable using a PowerShell script.​​​ When I run a tenanted deployment, I see that I get the value from the library set.

Is this similar to the setup you are working with?

Best regards,​
Mark Butler

Thanks. That fixed it.
My problem was that I had the wrong environment scoped in the library set. I noticed it when stepping through you examples.

Hey @don.chambers.pub,

Awesome! Happy to hear everything worked out :blush:.

Best regards,
Mark Butler