-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Username password account variable (#2059)
* add username password page * images * change nav order * Update dictionary-octopus.txt * Spelling related fixes --------- Co-authored-by: Steve Fenton <[email protected]>
- Loading branch information
1 parent
552b394
commit e5d675f
Showing
7 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ octopusdeploy | |
octopusid | ||
octopuslabs | ||
octopusservernodes | ||
octopusvariable | ||
Octostache | ||
OIDC | ||
onlylogs | ||
|
Binary file added
BIN
+66.8 KB
...docs/projects/variables/images/username-password-account-variable-selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94.4 KB
public/docs/projects/variables/images/username-password-account-variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/pages/docs/projects/variables/username-password-account-variables.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
layout: src/layouts/Default.astro | ||
pubDate: 2023-10-27 | ||
modDate: 2023-10-27 | ||
title: Username and password account variables | ||
description: Create a Username and password account variable to use in any deployment step | ||
navOrder: 90 | ||
--- | ||
|
||
[Username and password accounts](/docs/infrastructure/accounts/username-and-password/) can be referenced in a project through a project [variable](/docs/projects/variables) of the type **UsernamePassword account**. Before you create a Username and Password account Variable, you need to create a Username and Password account in Octopus: | ||
|
||
:::figure | ||
![Username Password account variable](/docs/projects/variables/images/username-password-account-variable.png) | ||
::: | ||
|
||
The **Add Variable** window is then displayed and lists all the Username and Password accounts. | ||
|
||
Select the Username and Password account you want to access from the project to assign it to the variable: | ||
|
||
:::figure | ||
![Username Password account variable selection](/docs/projects/variables/images/username-password-account-variable-selection.png) | ||
::: | ||
|
||
|
||
## Username and password account variable properties | ||
|
||
The Username and Password account variable also exposes the following properties that you can reference in a PowerShell script: | ||
|
||
| Name and description | Example | | ||
|------------------------------------------------------------------------|-------------| | ||
| **`Username`** <br/> The username of the Username and password account | BobSmith_85 | | ||
|
||
### Accessing the properties in a script | ||
|
||
Each of the above properties can be referenced in any of the supported scripting languages such as PowerShell and Bash. | ||
|
||
<details data-group="project-variables-username-password-account-variables"> | ||
<summary>PowerShell</summary> | ||
|
||
```powershell | ||
# For an account with a variable name of 'username password account' | ||
# Using $OctopusParameters | ||
Write-Host 'UsernamePasswordAccount.Id=' $OctopusParameters["username password account"] | ||
Write-Host 'UsernamePassword.Username=' $OctopusParameters["username password account.Username"] | ||
# Directly as a variable | ||
Write-Host 'UsernamePassword.Id=' #{username password account} | ||
Write-Host 'UsernamePassword.Username=' #{username password account.Username} | ||
``` | ||
|
||
</details> | ||
<details data-group="project-variables-username-password-account-variables"> | ||
<summary>Bash</summary> | ||
|
||
```bash | ||
# For an account with a variable name of 'username password account' | ||
|
||
id=$(get_octopusvariable "username password account") | ||
client=$(get_octopusvariable "username password.Username") | ||
echo "Username Password Account Id is: $id" | ||
echo "Username Password Account Username is: $username" | ||
``` | ||
|
||
</details> | ||
|
||
## Add a Username and Password account to Octopus | ||
|
||
For instructions to set up a Username and Password account in Octopus, see [Username and password accounts](/docs/infrastructure/accounts/username-and-password). | ||
|
||
## Learn more | ||
|
||
- [Variable blog posts](https://octopus.com/blog/tag/variables) | ||
- How to create [Username and password accounts](/docs/infrastructure/accounts/username-and-password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters