kickstart-pim-activation
Skill65 starsChanged 3 months agoMITView on GitHub
PIM (Privileged Identity Management) eligible role activation. Checks for activatable roles via az rest and guides the user through portal-based activation when they hit 403 errors on role assignments.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- vscode-aks-tools-release-prSkill
- kickstart-acr-integrationSkill
- kickstart-bicep-authoringSkill
- kickstart-cluster-statusSkill
- kickstart-collaborator-voiceSkill
- kickstart-configure-infraSkill
- kickstart-deploySkill
- kickstart-designSkill
- kickstart-discoverSkill
- kickstart-file-generationSkill
- kickstart-generateSkill
- kickstart-github-pr-conventionsSkill
- kickstart-handoffSkill
- kickstart-phase-accelerationSkill
- kickstart-reviewSkill
- kickstart-safeguard-checklistSkill
- kickstart-samplesSkill
- kickstart-security-hardeningSkill
- kickstart-workload-identitySkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
When the user gets a 403 on az role assignment create or az aks update --attach-acr (meaning they lack …
- Very specific: line 39
If canCreate === true: skip PIM activation entirely.
- Very specific: line 40
If canCreate === false and eligiblePimRoles.length > 0: render markdown in the chat, then proceed to Step 2 for activation guidance.
- Very specific: line 41
If canCreate === false and eligiblePimRoles.length === 0 (or eligiblePimRoles is missing): render markdown and proceed to Step 3 (admin …
- Very specific: line 42
If error is set: render the error and fall back to the manual az rest query below.
- Very specific: line 79
Use vscode_askQuestions to ask the user to confirm activation.
- Distinctive: line 85
Ask the user to confirm once their admin has run it
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PIM Eligible Role Activation
When the user gets a 403 on az role assignment create or az aks update --attach-acr (meaning they lack Microsoft.Authorization/roleAssignments/write), check whether they have PIM-eligible roles they can self-activate before falling back to admin hand-off.
Step 1 — Run the built-in permissions check (preferred)
Invoke the bundled VS Code command via vscode/runCommand. It performs the active-permissions check and the PIM eligibility lookup in one call, and returns a self-contained markdown report you can render directly in the chat.
Command ID: aks.checkRoleAssignmentPermissions
Args:
{
"subscriptionId": "<sub>",
"resourceGroup": "<rg>"
}Returns:
{
cancelled: boolean,
canCreate?: boolean, // true if the user can already create role assignments
scope?: { subscriptionId, subscriptionName, resourceGroup, resourceGroupScopeId },
verdict?: { canCreate, grantingActions, strippedByNotActions },
eligiblePimRoles?: Array<{ roleName, scopeId, scopeDisplayName?, grantingAction? }>,
markdown: string // full report — render this verbatim in chat
}How to use the result:
- If
canCreate === true: skip PIM activation entirely; retry the originalaz role assignment create/az aks update --attach-acr. - If
canCreate === falseandeligiblePimRoles.length > 0: rendermarkdownin the chat, then proceed to Step 2 for activation guidance. - If
canCreate === falseandeligiblePimRoles.length === 0(oreligiblePimRolesis missing): rendermarkdownand proceed to Step 3 (admin hand-off). - If
erroris set: render the error and fall back to the manualaz restquery below.
Manual fallback (only if the command is unavailable):
az rest --method GET \
--uri "https://management.azure.com/subscriptions/<sub>/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?\$filter=asTarget()&api-version=2020-10-01" \
--query "value[].{role:properties.roleDefinition.displayName, scope:properties.scope}" \
-o tableStep 2 — If eligible roles found
Show the user which roles they can activate and link them to the resource's IAM page in the portal. Construct the link using the resource type that failed:
For AKS cluster resources:
https://portal.azure.com/#@<tenant>/resource/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerService/managedClusters/<cluster>/usersFor ACR resources:
https://portal.azure.com/#@<tenant>/resource/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerRegistry/registries/<acr>/usersThen give these instructions:
You have PIM-eligible roles you can activate. Open the link below to activate a role that grants the needed permission:
<portal link>
- Click "View my access"
- Select the "Eligible assignments" tab
- Find a role that grants the needed permission (e.g. Owner, Contributor, or User Access Administrator) and click "Activate"
- Fill in the justification and duration, then confirm
- Come back here and let me know once it's activated
Use vscode_askQuestions to ask the user to confirm activation. After they confirm, wait 30 seconds for propagation, then validate by retrying the command that originally failed. If it still fails, suggest waiting another minute and retrying once more.
Step 3 — If no eligible roles found
Fall back to admin hand-off:
- Print the exact
az role assignment createcommand the admin needs to run - Ask the user to confirm once their admin has run it
- Validate by retrying the failed command or polling
az role assignment list
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

