You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cost-management-billing/manage/discover-cloud-footprint.md
+58-2Lines changed: 58 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Discover your Microsoft cloud footprint FAQ
3
3
description: This article helps to answer frequently asked questions that customers have about their Microsoft cloud footprint.
4
4
author: bandersmsft
5
5
ms.author: banders
6
-
ms.date: 09/17/2024
6
+
ms.date: 12/11/2024
7
7
ms.topic: conceptual
8
8
ms.service: cost-management-billing
9
9
ms.subservice: cost-management
@@ -103,7 +103,63 @@ Administrators can manage trials and purchases that they made, and self-service
103
103
104
104
## How can I get a list of subscriptions and tenants for a billing account?
105
105
106
-
You can view the tenants associated with a subscription in the Azure portal on the **Subscriptions** page under **Cost Management + Billing**.
106
+
In the Azure portal, you can view the tenants associated with a subscription on the **Subscriptions** page under **Cost Management + Billing**.
107
+
108
+
Programmatically, tyou can use the publicly available API to get billing accounts that returns all associated billing subscriptions. The API also supports an optional header that returns all tenant IDs associated with the billing account. For more information, see [Billing Subscriptions - List By Billing Account](/rest/api/billing/billing-subscriptions/list-by-billing-account).
109
+
110
+
CLI snippet:
111
+
112
+
```azurecli
113
+
# login
114
+
az login
115
+
# Get BillingAccounts
116
+
az rest --method get --url https://management.azure.com/providers/Microsoft.Billing/billingAccounts?api-version=2024-04-01
117
+
118
+
119
+
# Get BillingSubscriptions with provisioning tenant
120
+
az rest --method get --url https://management.azure.com/providers/Microsoft.Billing/billingAccounts/<BillingAccountId>/billingSubscriptions?api-version=2024-04-01 --headers x-ms-service-tenant-info=true
121
+
```
122
+
123
+
Sample call:
124
+
125
+
```azurecli
126
+
az rest --method get --url 'https://management.azure.com/providers/Microsoft.Billing/billingAccounts/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb:bbbbbbbb-1111-2222-3333-cccccccccccc_2019-05-31/billingSubscriptions?api-version=2024-04-01' --headers x-ms-service-tenant-info=true
0 commit comments