vscode-azureresourcegroups icon indicating copy to clipboard operation
vscode-azureresourcegroups copied to clipboard

Add Tenants view

Open motm32 opened this issue 1 year ago • 2 comments

Completes #849

Here is how the view will look: image

Detailed changes

Related to accounts:

  • This view will contain information related to accounts and tenants associated with those accounts. With this we also allow support users being signed into multiple accounts
  • If the user is not signed into any azure account the Tenants view will include a "Sign in" button similar to the Resources view.
  • With Multi-Account support there is the possibility that duplicate subscriptions can show up if the same subscription belongs to multiple tenants. In this case we will add in the description of the subscription item in the resources view the associated tenant so users know which tenant they are making changes under. This will look like this image

Related to tenants:

  • Checking and unchecking tenants within the view will update the subscriptions shown in the Resources view and the subscription filter. Along with this if the checked tenants or if no tenants match any subscriptions then by default all subscriptions will be shown.
  • If a tenant needs further authentication the tenant will default to being unchecked and a button will appear if a user hovers over the unauthenticated tenants which users can press to authenticate the tenant. Users can also right click on the unauthenticated tenant and click Sign in to Tenant. Finally if users check an unauthenticated tenant they will automatically be prompted to sign into that tenant. image

To do:

  • [x] Changes to the Sign out of Azure code so the tenants view also gets refreshed
  • [x] Integrate VSCode api changes to getsessions() once they are released
  • [x] Add multi-account support

motm32 avatar Jun 03 '24 23:06 motm32

Note for later: lets update the people in this issue once this is merged - https://github.com/microsoft/vscode-azure-account/issues/901

alexweininger avatar Aug 29 '24 13:08 alexweininger

Also just a note for reviewing. This includes a lot of code at the moment that is from the auth tools package for testing purposes. I will remove that code once we are closer to being done.

motm32 avatar Sep 03 '24 16:09 motm32

One comment. Make sure it supports Lighthouse. With Lighthouse you can view the same subscriptions under different tenants. Currently it works the halfway as you can see the subscriptions twice but you can only select the same subscription once to be displayed otherwise you will get error. Also currently of course you do not know which subscription selected is under which tenant.

slavizh avatar Nov 26 '24 07:11 slavizh

One comment. Make sure it supports Lighthouse. With Lighthouse you can view the same subscriptions under different tenants. Currently it works the halfway as you can see the subscriptions twice but you can only select the same subscription once to be displayed otherwise you will get error. Also currently of course you do not know which subscription selected is under which tenant.

Hi @slavizh thanks for pointing this out! Most of these issues should be resolved by some updates we have made recently. Before we plan to release if you would like we could send you a custom build so you can try the tenants view with Lighthouse 😊

motm32 avatar Nov 26 '24 20:11 motm32

@motm32 Yeah, no problem I will do some tests to verify.

slavizh avatar Nov 27 '24 06:11 slavizh

Hi @slavizh. Here is the custom vsix you can use to test Lighthouse! ResourceGroupsArtifacts.zip

On VS Code you can open the command prompt (ctrl + shift + P) and use the command Extensions: Install from VSIX... to install this version of the Resource Groups extension. You may need to reload your window for the view to appear. If you run into any issues please file them on this repo and if you have any questions please let us know!

motm32 avatar Dec 03 '24 17:12 motm32

@motm32 I did not spot any major issues but I would like to suggest some improvements:

  • When you select subscription it takes some time to display. Seems to me if that experience is faster will be better.
  • When you click on F1 select subscriptions the subscriptions takes some time to load when you have a lot of subscriptions. It will be better if this can be faster.
  • When I do F1 select tenant I have to sign in every time I choose a different tenant for the same account. Would be better if I can just sign in once and being able to switch tenants without having to sing in all over again.
  • When I do F1 select tenant and after that F1 select subscriptions regardless of the tenant chosen I see the same subscriptions. Either select tenant does not work properly or somehow it is useless as you see all subscriptions from all tenants. I cannot verify the latter with my account as I do not have subscriptions that are seen only in one of the tenants my account logs.
  • Specific to Lighthouse: The subscriptions I have access via directly on the tenant and via Lighthouse with the same account are visible only once when you do F1 select subscriptions. It is unclear to me from which access (RBAC or Lighthouse) I am viewing the subscriptions. I cannot verify as well which as from RBAC I have Owner and via Lighthouse I have contributor. May be this is related to the above issue if somehow select tenant is broken or all subscriptions are listed regarding of the tenant selected. I think it is useful to be able to see such subscriptions twice and being able to see which access you are using. For example may be there could be some grouping that shows available subscriptions per tenant in F1 select subscriptions.
  • Via Lighthouse I have access to multiple subscriptions from multiple tenants. When doing F1 select subscriptions I can see all these subscriptions but would be nice if I can somehow group the subscriptions by their tenant owner so I can easily select all subscriptions that belong to certain tenant. There is similar experience in Azure portal for Lighthouse. May be even can be done via some command like Select Subscriptions by Tenant Owner or something where you first choose the tenant owner and after that the subscriptions. Would be nice if also allows selecting multiple tenant owners before being able to select the subscriptions.

I hope this will be helpful.

slavizh avatar Dec 05 '24 09:12 slavizh

@motm32 ignore the last reply. I did not saw the new pane so will come back with new feedback after testing that.

slavizh avatar Dec 05 '24 09:12 slavizh

@motm32 My feedback after testing the accounts and tenant view:

  • Confirming that doing things like select subscriptions, selecting/deselecting tenants is slow. I have a lot of subscriptions but at the same time it feels like like I have to wait more than 15 seconds for resources pane to load after selecting/deselecting tenant. Same for subscriptions selection. Sometimes even shows loading for minutes.
  • For subscriptions for which I have access via Lighthouse and RBAC I can see them listed once when F1 select subscriptions. So I do not know which access I use to select them. From what I have tested the tenant where I am guest account and have direct access to the subscriptions via RBAC these subscriptions are missing, I can only see them via the tenant where the subscriptions are projected via Lighthouse. To verify that I have selected both tenants, selected those subscriptions, after deselecting the tenant where I have access to the subscriptions via RBAC the subscriptions disappear from Resources pane. While writing this and continue testing I noticed that sometimes also the same subscriptions appear no matter which tenant is selected. There is some inconstancy here which prevents identifying the correct behavior that is implemented.
  • When I deselect a tenant do F1 select subscriptions I see the subscriptions of the deselected tenant. That I think should not happen. Especially because when the tenant is deselected the subscriptions will not appear in Resources pane even when selected.
  • When you do F1 select subscriptions I think it is better to show the tenant name rather the tenant ID. In most cases the tenant ID does not meany anything to you but the tenant name/domain is something that is recognized.
  • I am seeing a lot of issues with selecting/deselecting tenants I deselect tenant in one account and in Resources pane the subscriptions of other account and tenant appear along the subscription of the deselected tenant stays. It is very strange.

This feedback that was from previous reply stays:

  • Specific to Lighthouse: The subscriptions I have access via directly on the tenant and via Lighthouse with the same account are visible only once when you do F1 select subscriptions. It is unclear to me from which access (RBAC or Lighthouse) I am viewing the subscriptions. I cannot verify as well which as from RBAC I have Owner and via Lighthouse I have contributor. May be this is related to the above issue if somehow select tenant is broken or all subscriptions are listed regarding of the tenant selected. I think it is useful to be able to see such subscriptions twice and being able to see which access you are using. For example may be there could be some grouping that shows available subscriptions per tenant in F1 select subscriptions.
  • Via Lighthouse I have access to multiple subscriptions from multiple tenants. When doing F1 select subscriptions I can see all these subscriptions but would be nice if I can somehow group the subscriptions by their tenant owner so I can easily select all subscriptions that belong to certain tenant. There is similar experience in Azure portal for Lighthouse. May be even can be done via some command like Select Subscriptions by Tenant Owner or something where you first choose the tenant owner and after that the subscriptions. Would be nice if also allows selecting multiple tenant owners before being able to select the subscriptions.

FYI I have over 700 subscriptions.

I hope this helps.

slavizh avatar Dec 05 '24 10:12 slavizh

@slavizh Thank you so much for your feedback it is very helpful 😊

motm32 avatar Dec 05 '24 17:12 motm32

If possible @slavizh could you provide a number of how many tenants you had in the view? For instance were the 700 subscriptions you mentioned were belonging to one tenant or spread across multiple?

motm32 avatar Dec 05 '24 21:12 motm32

@motm32 the subscriptions belong to multiple tenants because they are project via Lighthouse but I think in this case you are asking mostly if the subscriptions are seen from multiple tenants or from single one. In my case I have tenant where I have over 700 subscriptions, another tenant with 8 subscriptions. Those 8 are also seen on the other tenant via Lighthouse. These two tenants are under the same account. I also have my personal account where I have 2 subscriptions under one tenant. Over my personal account I also have 3 other tenants visible but there are no subscriptions for those.

slavizh avatar Dec 06 '24 06:12 slavizh