-
Notifications
You must be signed in to change notification settings - Fork 69
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
azure: Changes to managed identity steps so they are compatible with functions settings conversion #1889
base: main
Are you sure you want to change the base?
Conversation
@@ -506,4 +511,69 @@ export declare const CommonRoleDefinitions: { | |||
readonly description: "Allows for read, write and delete access to Azure Storage blob containers and data"; | |||
readonly roleType: "BuiltInRole"; | |||
}; | |||
readonly storageBlobDataOwner: { |
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.
where'd you find all this info from? I would put a link in a comment so we know where to get it in the future
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'll add a link
azure/index.d.ts
Outdated
|
||
public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>; | ||
public shouldExecute(wizardContext: T): boolean; | ||
} | ||
|
||
export interface Roles { |
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 Role
be more accurate?
Nit but do we want to localize the role descriptions? |
azure/src/constants.ts
Outdated
} as RoleDefinition | ||
} as const; | ||
|
||
export function createRoleId(subscriptionId: string, roleId: string): string { |
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 an easier to understand way to do this is to change the roleId: string
param into role: CommonRoleDefinitions
and then in the function itself, access the role id by doing role.name
const resourceType = scopeSplitArr[scopeSplitArr.length - 2] ?? ''; | ||
const roles = this.roles(); | ||
if (roles) { | ||
for (const role of roles) { |
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 don't think we would want to make the whole step fail if one role fails. Maybe do a try/catch so it can continue?
export interface Role { | ||
scopeId: string | undefined; | ||
roleDefinitionId: string; | ||
roleDefinitionName: string; | ||
} |
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.
Can you add doc strings to this interface?
Needed to make a couple changes to make the current managed identity steps compatible with converting settings.
Things I have changed:
ResourceGroupListStep
to theUserAssignedIdentityListStep
. Users who are converting will not have specified a resource group prior to choosing to create a managed identityRoleAssignmentExecuteStep
to assign multiple roles in the step. It is common not only for converting to assign more than one roleTODO: