oh-my-posh/website/docs/segments/az.mdx

63 lines
2.8 KiB
Plaintext
Raw Normal View History

---
id: az
title: Azure Subscription
sidebar_label: Azure
---
## What
Display the currently active Azure subscription information.
:::tip
PowerShell offers support for the [az][az] module, but it is disabled by default.
To enable this, set `$env:POSH_AZURE_ENABLED = $true` in your `$PROFILE` after
initializing Oh My Posh.
:::
## Sample Configuration
2023-03-31 11:55:36 -07:00
import Config from '@site/src/components/Config.js';
<Config data={{
"type": "az",
"style": "powerline",
2022-02-02 10:38:31 -08:00
"powerline_symbol": "\uE0B0",
"foreground": "#000000",
"background": "#9ec3f0",
"template": " \uebd8 {{ .EnvironmentName }}"
2023-03-31 11:55:36 -07:00
}}/>
## Properties
| Name | Type | Description |
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source` | `string` | <ul><li>`first_match`: try the CLI config first, then the PowerShell module. The first to resolve is displayed (**default**)</li><li>`cli`: fetch the information from the CLI config</li><li>`pwsh`: fetch the information from the PowerShell Module config</li></ul> |
2022-02-01 03:10:46 -08:00
## Template ([info][templates])
:::note default template
```template
2022-02-01 03:10:46 -08:00
{{ .Name }}
```
:::
### Properties
| Name | Type | Description |
| ------------------ | --------- | -------------------------------------------------------------- |
2023-02-04 11:36:30 -08:00
| `.EnvironmentName` | `string` | Azure environment name |
| `.HomeTenantID` | `string` | home tenant id |
2023-02-04 11:36:30 -08:00
| `.ID` | `string` | subscription id |
| `.IsDefault` | `boolean` | is the default subscription or not |
| `.Name` | `string` | subscription name |
| `.State` | `string` | subscription state |
| `.TenantID` | `string` | tenant id |
| `.User.Name` | `string` | user name |
| `.User.Type` | `string` | user type |
| `.Origin` | `string` | where we received the information from, can be `CLI` or `PWSH` |
2022-04-20 09:43:59 -07:00
[templates]: /docs/configuration/templates
2022-12-21 10:27:37 -08:00
[az]: https://www.powershellgallery.com/packages/Az