diff --git a/src/segments/az.go b/src/segments/az.go
index 45620ae37160..66c774ede150 100644
--- a/src/segments/az.go
+++ b/src/segments/az.go
@@ -33,15 +33,16 @@ type AzureConfig struct {
}
type AzureSubscription struct {
- ID string `json:"id"`
- Name string `json:"name"`
- State string `json:"state"`
- User *AzureUser `json:"user"`
- IsDefault bool `json:"isDefault"`
- TenantID string `json:"tenantId"`
- EnvironmentName string `json:"environmentName"`
- HomeTenantID string `json:"homeTenantId"`
- ManagedByTenants []any `json:"managedByTenants"`
+ ID string `json:"id"`
+ Name string `json:"name"`
+ State string `json:"state"`
+ User *AzureUser `json:"user"`
+ IsDefault bool `json:"isDefault"`
+ TenantID string `json:"tenantId"`
+ TenantDisplayName string `json:"tenantDisplayName"`
+ EnvironmentName string `json:"environmentName"`
+ HomeTenantID string `json:"homeTenantId"`
+ ManagedByTenants []any `json:"managedByTenants"`
}
type AzureUser struct {
@@ -66,7 +67,8 @@ type AzurePowerShellSubscription struct {
} `json:"ExtendedProperties"`
} `json:"Subscription"`
Tenant struct {
- ID string `json:"Id"`
+ ID string `json:"Id"`
+ Name string `json:"Name"`
} `json:"Tenant"`
}
@@ -126,10 +128,12 @@ func (a *Az) getModuleSubscription() bool {
if len(envSubscription) == 0 {
return false
}
+
var config AzurePowerShellSubscription
if err := json.Unmarshal([]byte(envSubscription), &config); err != nil {
return false
}
+
a.IsDefault = true
a.EnvironmentName = config.Environment.Name
a.TenantID = config.Tenant.ID
@@ -140,7 +144,10 @@ func (a *Az) getModuleSubscription() bool {
Name: config.Subscription.ExtendedProperties.Account,
Type: config.Account.Type,
}
+ a.TenantDisplayName = config.Tenant.Name
+
a.Origin = "PWSH"
+
return true
}
diff --git a/website/docs/segments/cloud/az.mdx b/website/docs/segments/cloud/az.mdx
index 000bd0bbd9da..3ddee8e9bb71 100644
--- a/website/docs/segments/cloud/az.mdx
+++ b/website/docs/segments/cloud/az.mdx
@@ -16,23 +16,25 @@ initializing Oh My Posh.
## Sample Configuration
-import Config from '@site/src/components/Config.js';
+import Config from "@site/src/components/Config.js";
-