Azure-docs: Description of cmdlet differs from current experience

Created on 30 Jul 2020  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

The Azure PowerShell Get-AzSubscription cmdlet shows the tenantID for each subscription, allowing you to identify whether a returned subscription belongs to your service provider tenant or to a managed customer tenant.

When using the Get-AzSubscription cmdlet the subscriptions with delegations from a customer tenant are shown with the MSP's Azure AD Tenant ID and not the customer's.

Unsure if this description is incorrect or the cmdlet is returning an unexpected result.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author doc-enhancement lighthoussvc triaged

All 5 comments

@Snozzberries Thank you for the feedback. We will work on it and will keep you updated on the thread

For additional context and reproduction, I have two Azure AD tenants. An MSP Azure AD tenant (1a7c), and a Customer Azure AD tenant (ed2f). Within the customer tenant there exists a subscription (*0b89).

When I am authenticated to the MSP tenant without specifying a TenantId or SubscriptionId for Connect-AzAccount I am able to see the customer subscription with a TenantId of the MSP (*1a7c) when I run Get-AzSubscription.

If I subsequently Clear-AzContext and Connect-AzAccount -SubscriptionId *0b89 -TenantId *ed2f (Azure Delegated Resource Management role assignments have been created outside of Lighthouse) and issue Get-AzSubscription the TenantId is returned as the currently authenticating Azure AD tenant ID (*ed2f).

Thanks @Snozzberries for all the details and for reporting the issue. We have confirmed that Get-AzSubscription does not currently show the customer's TenantId, as you have observed. I've created a PR to update the docs accordingly. When it merges, this issue will automatically close. The update will appear in the topic shortly after that. Thanks again for your feedback!

Hi again @Snozzberries - wanted to let you know that we've updated this article again, as the Azure PowerShell Get-AzSubscription cmdlet will now show the HomeTenantId and ManagedByTenantIds attributes for each subscription. Please give it a try and let us know if you have further questions!

Works perfectly @JnHs, thank you for the update!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jharbieh picture jharbieh  Â·  3Comments

jebeld17 picture jebeld17  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments