Azure Resources and Permissions

This page documents every Azure resource that Container Assist creates on your behalf, every role assignment it makes, and the Azure permissions you need to use the feature.

Prerequisites: Azure Account Permissions

Container Assist operates across multiple resource groups and requires both resource management and role assignment permissions. This section explains which built-in roles work, which don’t, and why.

Which built-in roles work?

RoleScopeSufficient?Why
OwnerSubscriptionYesHas full resource management and role assignment permissions.
Contributor + User Access AdministratorSubscriptionYesContributor handles resource creation; User Access Administrator handles role assignments.
Contributor (alone)SubscriptionNoCan create resource groups, managed identities, and federated credentials, but cannot assign RBAC roles. All 9 role assignments will fail.
Contributor (alone)Resource groupNoCannot list clusters/ACRs across the subscription, cannot create the OIDC resource group, and cannot assign roles.

Why Contributor alone is not enough: The Contributor role explicitly excludes Microsoft.Authorization/roleAssignments/write. Container Assist assigns up to 9 RBAC roles across multiple resources (see Role Assignments below). Without role assignment permissions, the OIDC setup completes partially – the managed identity and federated credential are created, but the pipeline will fail at runtime because the identity lacks access to the cluster and ACR. The extension warns you which roles could not be assigned so you can request them from an admin.

Why subscription-level access is needed

Container Assist touches up to 4 separate resource groups during a single run:

Resource groupWhat happens there
OIDC identity RG (e.g. rg-myapp-oidc)Created if it doesn’t exist. Managed identity and federated credential are created here.
AKS cluster RGAKS Cluster User Role and AKS RBAC Writer are assigned here. Cluster properties are read.
ACR RGAcrPull, AcrPush, and ACR Tasks Contributor are assigned here. May be a different RG than the cluster.
Node RG (MC_*)Kubelet identity is read from the cluster object (no direct operations).

The extension also lists all AKS clusters and ACRs across the subscription during the selection wizard, which requires subscription-level read access (Microsoft.Resources/subscriptions/resources/read).

If your account is scoped to a single resource group, the cluster/ACR listing fails before you can even start.

Detailed permission breakdown

For least-privilege or custom role setups, here are the specific permissions required:

PermissionWhyWhen
Microsoft.Authorization/roleAssignments/writeAssign RBAC roles to managed identities and AKS kubelet identityACR attachment and OIDC setup
Microsoft.ManagedIdentity/userAssignedIdentities/writeCreate managed identitiesOIDC setup (if creating new identity)
Microsoft.ManagedIdentity/userAssignedIdentities/readList/read existing managed identitiesOIDC setup (if reusing identity)
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/writeCreate OIDC federated credentialsOIDC setup
Microsoft.Resources/subscriptions/resourceGroups/writeCreate resource groupsOIDC setup (if resource group does not exist)
Microsoft.Resources/subscriptions/resources/readList resources across the subscriptionCluster and ACR selection wizard
Microsoft.ContainerService/managedClusters/readRead AKS cluster propertiesCluster selection, Azure RBAC check
Microsoft.ContainerRegistry/registries/readList and read ACR registriesACR selection
Microsoft.ContainerService/managedClusters/listClusterUserCredential/actionList namespacesNamespace selection

These permissions must be granted at subscription scope (or across all relevant resource groups) for the full workflow to succeed.

Azure Resources Created

Container Assist may create the following Azure resources during the OIDC setup flow. These resources appear in your Azure subscription and may incur governance or cost implications.

Resource Group

AttributeValue
Resource typeMicrosoft.Resources/resourceGroups
When createdDuring OIDC setup, if the specified resource group does not already exist
Default namerg-<appName>-oidc (user-editable)
User consentImplicit – you enter the resource group name, but are not separately prompted to confirm creation

User-Assigned Managed Identity

AttributeValue
Resource typeMicrosoft.ManagedIdentity/userAssignedIdentities
When createdDuring OIDC setup, if you choose “Create new managed identity”
Default nameid-<appName>-github (user-editable)
Tagspurpose: "GitHub Actions OIDC", createdBy: "AKS VS Code Extension"
User consentYou explicitly choose “Create new” vs. “Use existing” before creation

Note: If you select “Use existing managed identity”, no new identity is created. The selected identity is reused.

Federated Identity Credential

AttributeValue
Resource typeFederated Identity Credential on the managed identity
When createdDuring OIDC setup, automatically after identity is created or selected
Credential nameGitHubActions (fixed)
Issuerhttps://token.actions.githubusercontent.com
Subjectrepo:<owner>/<repo>:ref:refs/heads/<branch>
Audiencesapi://AzureADTokenExchange
User consentAutomatic – created as part of the OIDC setup progress after you initiate it

The subject uses your repository’s owner/repo from the git remote and the detected default branch (usually main).

Role Assignments

Container Assist assigns Azure RBAC roles at two distinct stages: ACR selection (during the main wizard) and OIDC setup (when configuring the GitHub workflow pipeline). The principals and scopes differ between these stages.

Stage 1: ACR Selection (Main Wizard)

When you select an Azure Container Registry that is not already attached to your AKS cluster, the extension offers to assign the AcrPull role:

RoleRole Definition IDScopePrincipalConsent
AcrPull7f951dda-4ed3-4680-a7ca-43fe172d538dACR resourceAKS kubelet (agentpool) identityPrompted – you see a dialog with “Assign AcrPull Now” / “Dismiss”

Why: This allows your AKS cluster to pull container images from the selected ACR at runtime. Without this, pod image pulls will fail with authentication errors.

Principal: The AKS cluster’s kubelet identity (from identityProfile.kubeletidentity). For service-principal-based clusters, the service principal is used instead.

Stage 2: OIDC Setup (GitHub Workflow Pipeline)

When you run the OIDC setup to configure GitHub Actions authentication, role assignments are created for the OIDC managed identity (the identity that your GitHub Actions workflow uses to authenticate with Azure). The roles assigned depend on whether you are deploying to a user namespace or a managed namespace.

User Namespace Path

For standard (non-managed) Kubernetes namespaces:

#RoleRole Definition IDScopePurpose
1Azure Kubernetes Service Cluster User Role4abbcc35-e782-43d8-92c5-2d3f1bd2253fResource group containing the AKS clusterAllows the workflow to get cluster credentials (kubeconfig)
2AcrPush8311e382-0749-4cb8-b61a-304f252e45ecACR resourceAllows the workflow to push built container images to ACR
3Container Registry Tasks Contributorfb382eab-e894-4461-af04-94435c366c3fACR resourceAllows the workflow to run az acr build (cloud-based image builds)
4Azure Kubernetes Service RBAC Writera7ffa36f-339b-4b5c-8bdf-e2c188b2c0ebAKS cluster resourceAllows the workflow to deploy workloads to the cluster. Only assigned if Azure RBAC is enabled on the cluster.

Note on role #4: The AKS RBAC Writer role is only assigned when the cluster has Azure RBAC enabled (aadProfile.enableAzureRBAC). If the cluster uses Kubernetes-native RBAC instead, this role is skipped and you will need to create a Kubernetes ClusterRoleBinding or RoleBinding manually.

Managed Namespace Path

For AKS managed namespaces, roles are scoped to the specific namespace rather than the entire cluster:

#RoleRole Definition IDScopePurpose
1Azure Kubernetes Service RBAC Writera7ffa36f-339b-4b5c-8bdf-e2c188b2c0ebManaged namespaceKubernetes data-plane access (create/update deployments, services, configmaps, etc.)
2Azure Kubernetes Service Namespace Contributor289d8817-ee69-43f1-a0af-43a45505b488Managed namespaceARM-level access to fetch namespace-scoped kubeconfig
3AcrPush8311e382-0749-4cb8-b61a-304f252e45ecACR resourcePush container images to ACR
4Container Registry Tasks Contributorfb382eab-e894-4461-af04-94435c366c3fACR resourceRun az acr build for cloud-based image builds