If Machine has multiple Tenants assigned

Hello,

is there a way to check, if a Machine has multiple Tenants assigned?
I’d like to add the tenant name when there are multiple instances installed.

Thanks,
Jan

Hi Jan,

Thanks for getting in touch! There’s no easy way to detect if a Machine has one Tenant or multiple Tenants assigned to it when you’re deploying.

I would recommend adding the Tenant Name whether there is one Tenant on the Machine or multiple Tenants. This is the same choice we’ve made with the default installation directory when you deploy a package. We use a path like \TenantName\EnvironmentName\ProjectName\ReleaseNumber\ for all tenanted deployments, regardless of how many Tenants may potentially be hosted on that Machine.

Hope that helps!
Mike

Hi Mike,

thanks, I thought about that too. Unfortunately we don’t want our Customers to see their own name as most machines are only used for one customer. I have currently set it up using two steps and added a Tenant-Tag “Multi-Tenant”. Can I somehow use a Tenant-Tag as a boolean value? That would at least remove the need for a second step.

Jan

Hi Jan,

Thanks for getting back to me! In that case you might try this variable as part of your deployment which is a comma-separated list of the specific tenants assigned to the Machine: Octopus.Machine.TenantIds

This won’t help in the case where you map Tenants to a Machine using Tenant Tags.

Hope that helps!
Mike

Hi Mike,

thank you again. I got it to work as needed using Octopus.Machine.TenantIds. I now check if it contains a comma in a custom PowerShell Script and add the Tenant-Name if needed.

Jan

Hi Jan,

Thanks for getting back to me. I’m glad that worked!
Don’t hesitate to reach out if we can help in any other way. :slight_smile:

Happy Deployments!
Mike