Google Cloud account variables

Google Cloud accounts are included in a project through a project variable of the type Google Cloud Account. Before you create a Google Cloud account variable, you need to create a Google Cloud account in Octopus:

Google Cloud account variable

The Add Variable window is then displayed and lists all the Google Cloud accounts.

Select the Google Cloud account you want to access from the project to assign it to the variable:

Google Cloud account variable selection

Google Cloud account variable properties

The Google Cloud account variable also exposes the following properties that you can reference in a PowerShell script:

Name and description
JsonKey
The JSON Key for the Google Cloud account.
Only set if Use a Key File is selected
OpenIdConnect.Jwt
The JWT identity token for the current task.
Only set if Use OpenID Connect is selected
Audience
The Workload Identity Federation audience.
Only set if Use OpenID Connect is selected
OpenIdConnect.TokenLifetimeSeconds
The lifetime, in seconds, of the federated Google Cloud access token (600–43200, default 3600), passed to gcloud as --service-account-token-lifetime-seconds. Set from the account’s Token Lifetime when Use OpenID Connect is selected. A Generic OpenId Connect account has no Token Lifetime setting, so define this variable yourself to override the 3600 default.

Accessing the properties in a script

Each of the above properties can be referenced in PowerShell.

# For an account with a variable name of 'google cloud account'

# Using $OctopusParameters
Write-Host 'GoogleCloudAccount.Id=' $OctopusParameters["google cloud account"]
Write-Host 'GoogleCloudAccount.JsonKey=' $OctopusParameters["google cloud account.JsonKey"]

# Directly as a variable
Write-Host 'GoogleCloudAccount.Id=' #{google cloud account}
Write-Host 'GoogleCloudAccount.JsonKey=' #{google cloud account.JsonKey}

# For an account using OpenID Connect
Write-Host 'GoogleCloudAccount.OpenIdConnect.Jwt=' #{google cloud account.OpenIdConnect.Jwt}
Write-Host 'GoogleCloudAccount.OpenIdConnect.TokenLifetimeSeconds=' #{google cloud account.OpenIdConnect.TokenLifetimeSeconds}

Add a Google Cloud account to Octopus

For instructions to set up a Google Cloud account in Octopus, see Google Cloud Accounts.

Older versions

  • Google Cloud accounts are available from Octopus Deploy 2021.3 onwards.

Learn more

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Thursday, July 9, 2026

Use Octopus docs with AI