-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read-only Implementation of Managed Identities #933
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this new view, going to be super useful for working with identities going forward 🥳
async getChildren(element: ResourceGroupsItem): Promise<ResourceGroupsItem[] | null | undefined> { | ||
return (await element.getChildren?.())?.map((child) => { | ||
if (child.id) { | ||
return ext.azureTreeState.wrapItemInStateHandling(child, () => this.refresh(child)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding, is it safe to say that all resource tree items need to be returned wrapped? I'm guessing child.id
being defined would only happen in the case that the item had not yet been wrapped, hence check for that to determine if we need to wrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may not actually need the id check, I think I was just imitating something. I'll remove it.
As for what it's actually doing, I think the state handling stuff is due to a weird issue in VS Code where it only records the initial state of a tree node, but doesn't keep track of it.
Alex and Brandon had to do this to fix some bug about loading all of a tree's children only if the tree was expanded.
iconPath = getIconPath(getAzExtResourceType({ type: parsedAzureResourceId.provider })); | ||
} | ||
catch (error) { | ||
// if this fails, then it was a resource group ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could also fail if the scope is a subscription ID, so might need a fallback for that scenario as well (otherwise the user might see an ID parsing error).
src/utils/azureUtils.ts
Outdated
@@ -101,6 +101,7 @@ const azExtDisplayInfo: Partial<Record<AzExtResourceType, AzExtResourceTypeDispl | |||
Images: { displayName: localize('images', 'Images') }, | |||
LoadBalancers: { displayName: localize('loadBalancers', 'Load balancers') }, | |||
LogicApp: { displayName: localize('logicApp', 'Logic App') }, | |||
ManagedIdentityUserAssignedIdentities: { displayName: localize('managedIdentity', 'Managed Identity (Read-Only)') }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be useful / is there a good way for us to indicate (maybe as like a description) that the Managed Identities group is specifically for user-assigned
identities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of (Read-Only) change it to:
Managed Identity (User Assigned)
…osoft/vscode-azureresourcegroups into nat/managedIdentityReadOnly
TODO: I'll add more description tomorrow. Already kind of late.
There is a bug right now-- because the scope id I'm using to determine the app type is just an Azure id string, it can't tell the difference between app service and functions.
I could do something like retrieving that resource when we see a
Microsoft.site
provider, but that kind of seems like overkill at this point.