Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ResourceManager/Profile/Commands.Profile/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Fix issue with Get-AzureRmSubscription in CloudShell

## Version 5.6.0
* Minor changes to the storage common code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,24 @@ public override void ExecuteCmdlet()
{
try
{
var subscriptions = _client.ListSubscriptions(tenant);
WriteObject(subscriptions.Select((s) => new PSAzureSubscription(s)), enumerateCollection: true);
if (DefaultContext.Account.Type.Equals("ManagedService"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file an issue to add some automation for this - we have the infrastructure to mock managed service tests, and we should have some regression protection for thsi scenario.

Please make sure you have tested this in CloudShell. LMK if you need some help in doign this.

{
if (tenant == null)
{
tenant = DefaultContext.Tenant.Id;
}

if (tenant.Equals(DefaultContext.Tenant.Id))
{
var subscriptions = _client.ListSubscriptions(tenant);
WriteObject(subscriptions.Select((s) => new PSAzureSubscription(s)), enumerateCollection: true);
}
}
else
{
var subscriptions = _client.ListSubscriptions(tenant);
WriteObject(subscriptions.Select((s) => new PSAzureSubscription(s)), enumerateCollection: true);
}
}
catch (AadAuthenticationException exception)
{
Expand Down