riweston / aztx

MIT License
19 stars 3 forks source link

Feature Request: Tenant-Specific Subscription Management #37

Open lonix opened 2 months ago

lonix commented 2 months ago

Summary: As a user managing multiple Azure subscriptions on behalf of various customers, I would like the ability to view and organize subscriptions by Tenant in my portfolio. This would significantly improve usability when dealing with a large number of subscriptions.

Description: I manage numerous Azure subscriptions across multiple tenants. It would be highly beneficial to have the option to display the Tenant in its own column within the subscription management interface. Ideally, subscriptions could also be grouped by Tenant, allowing for more efficient navigation and management.

In an ideal scenario, I envision a workflow where I can first select a Tenant and then choose from the associated subscriptions. This hierarchical selection process would streamline the management experience, particularly for users handling a large number of subscriptions.

Considerations:

•   The ability to view subscriptions grouped by Tenant might not be relevant to all users, so it could be offered as an optional feature.
•   Implementing a “Select Tenant -> Select Subscription” workflow could significantly enhance the user experience for those managing multiple tenants.

Conclusion: This feature would greatly enhance the management of multiple Azure subscriptions by simplifying navigation and improving the organization. The current product is already excellent, and this enhancement would make it even better.

riweston commented 2 months ago

I really like this idea! 👍

I'm thinking about how best to implement this, few ideas;

Something else to consider is that this program manipulates the config file in $HOME/.azure/azureProfile.json and something that I've noticed, at least in my case, is that I have access to a couple of Azure environments and one is quite locked down so I can't see the tenantDisplayName field. I've sanitised the contents but take a look at this...

azureProfile.json snippet ```json { "subscriptions": [ { "id": "11111111-1111-1111-1111-111111111111", "name": "N/A(tenant level account)", "state": "Enabled", "user": { "name": "user1@example.com", "type": "user" }, "isDefault": false, "tenantId": "11111111-1111-1111-1111-111111111111", "environmentName": "AzureCloud" }, { "id": "22222222-2222-2222-2222-222222222222", "name": "N/A(tenant level account)", "state": "Enabled", "user": { "name": "user1@example.com", "type": "user" }, "isDefault": false, "tenantId": "22222222-2222-2222-2222-222222222222", "environmentName": "AzureCloud" }, { "id": "33333333-3333-3333-3333-333333333333", "name": "User2 MSDN", "state": "Enabled", "user": { "name": "user2@company.com", "type": "user" }, "isDefault": true, "tenantId": "44444444-4444-4444-4444-444444444444", "environmentName": "AzureCloud", "homeTenantId": "44444444-4444-4444-4444-444444444444", "tenantDefaultDomain": "company.com", "tenantDisplayName": "CompanyName", "managedByTenants": [] } ], "installationId": "55555555-5555-5555-5555-555555555555" } ```

As you can see in the first 2 subscriptions the tenantDisplayName field is missing we'd need consider whether to present the tenantId UUID field in the tenant selector (which obviously isn't very friendly or readable) or just group all the subscriptions together that don't have a tenantDisplayName field for better usability.

Would be keen to get your thoughts!

lonix commented 1 month ago

I Can see that in my case, not a single instance of the variable tenantDisaplyName even exists. making it either a "Group only" or the need for the user to create a custom map of tenantID > tenantDisplayName. perferably though i would personally like to not use parameters when i launch the application myself.

riweston commented 1 month ago

Interesting idea...so maybe a hotkey combo like Ctrl + N that lets you nickname the IDs?

lonix commented 1 month ago

That could work, but at this point, i think we need to go towards a ".config" file to store this outside memory right ?

riweston commented 1 month ago

There is already a config file generated in your profile that's used to track the previously subscription context for switching back and forth so I think I could just lean on that to additionally track any custom names and/or configuration options like "always select the tenant first" for instance 🤔

lonix commented 1 month ago

Seems valid.