Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: src/layouts/Default.astro
pubDate: 2023-01-01
modDate: 2025-05-07
modDate: 2026-01-20
title: octopus tenant variables update
description: Update the value of a tenant variable
navOrder: 145
Expand All @@ -10,7 +10,7 @@ import SamplesInstance from 'src/shared-content/samples/samples-instance.include

Update the value of a tenant variable in Octopus Deploy

```
```text
Usage:
octopus tenant variables update [flags]

Expand All @@ -35,15 +35,29 @@ Global Flags:

<SamplesInstance />

```
```bash
# Interactive mode - prompts for all required values
$ octopus tenant variables update

# Update a project variable for a specific environment (single environment scope)
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "site-name" --value "Bob's Fish Shack" --project "Awesome Web Site" --environment "Test"
$ octopus tenant variables update --tenant "Sally's Tackle Truck" --name dbPassword --value "12345" --library-variable-set "Shared Variables"

# Update a project variable for multiple environments (multiple environment scopes)
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "database-server" --value "prod-db-01" --project "Awesome Web Site" --environment "Staging" --environment "Production"

# Update a project variable for all environments (unscoped - omit --environment flag)
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "app-name" --value "Bobs App" --project "Awesome Web Site"

# Update a common variable from a library variable set
$ octopus tenant variables update --tenant "Sally's Tackle Truck" --name "dbPassword" --value "12345" --library-variable-set "Shared Variables"

# Update a common variable with environment scoping
$ octopus tenant variables update --tenant "Sally's Tackle Truck" --name "api-key" --value "prod-key-123" --library-variable-set "API Config" --environment "Production"


```

## Learn more

- [Octopus CLI](/docs/octopus-rest-api/cli)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
13 changes: 8 additions & 5 deletions src/pages/docs/octopus-rest-api/cli/octopus-tenant-variables.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: src/layouts/Default.astro
pubDate: 2023-01-01
modDate: 2025-05-07
modDate: 2026-01-20
title: octopus tenant variables
description: Manage tenant variables
navOrder: 143
Expand All @@ -10,7 +10,7 @@ import SamplesInstance from 'src/shared-content/samples/samples-instance.include

Manage tenant variables in Octopus Deploy

```
```text
Usage:
octopus tenant variables [command]

Expand All @@ -36,14 +36,17 @@ Use "octopus tenant variables [command] --help" for more information about a com

<SamplesInstance />

```
```bash
$ octopus tenant variables list "Bobs Wood Shop"
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "site-name" --value "Bob's Fish Shack" --project "Awesome Web Site" --environment "Test"

# Update a project variable for a specific environment (single environment scope)
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "site-name" --value "Bob's Fish Shack" --project "Awesome Web Site" --environment "Test"

# Update a common variable from a library variable set for specific environments
$ octopus tenant variables update --tenant "Bobs Fish Shack" --name "company-logo" --value "bobs-logo.png" --library-variable-set "Shared Assets" --environment "Production"
```

## Learn more

- [Octopus CLI](/docs/octopus-rest-api/cli)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
layout: src/layouts/Default.astro
pubDate: 2023-01-01
modDate: 2023-01-01
modDate: 2026-01-20
title: Update tenant variables
description: An example script that updates tenant variables for a specific project template with a single value across each connected environment in Octopus using the REST API and Octopus.Client.
description: Example scripts that update tenant variables for both project variables and common (library) variables in Octopus using the REST API and Octopus.Client.
---
import UpdateTenantVariableScripts from 'src/shared-content/scripts/update-tenant-variable-scripts.include.md';
import UpdateTenantProjectVariableScripts from 'src/shared-content/scripts/update-tenant-project-variable-scripts.include.md';
import UpdateTenantCommonVariableScripts from 'src/shared-content/scripts/update-tenant-common-variable-scripts.include.md';

This script demonstrates how to programmatically update tenant variables with a single value across each connected environment in Octopus.
These scripts demonstrate how to programmatically update tenant variables.

## Usage
## Update project tenant variables

Provide values for:

Expand All @@ -21,6 +22,18 @@ Provide values for:
- The new variable value
- Choose whether the new variable value is bound to an Octopus variable value e.g. `#{MyVariable}`

## Script
<UpdateTenantProjectVariableScripts />

<UpdateTenantVariableScripts />
## Update common tenant variables

Provide values for:

- Octopus URL
- Octopus API Key
- Name of the space to use
- Name of the tenant
- Name of the Library template
- The new variable value
- Choose whether the new variable value is bound to an Octopus variable value e.g. `#{MyVariable}`

<UpdateTenantCommonVariableScripts />
Loading