/azure-graph-dotnet:deploy-azure [--functions | --container-job] [--resource-group rg-name] [--location eastus]from azure-graph-dotnet
Provisions Azure infrastructure with Bicep, deploys a C# Azure Functions or Container Job project, pushes container images to ACR, assigns Managed Identity Graph permissions, and generates CI/CD pipelines for GitHub Actions or Azure DevOps.
Ships in azure-graph-dotnet. Installing the plugin adds it to Claude Code.
End-to-end deployment of a C# Azure Functions or Container Job project to Azure.
Read the project structure to determine what to deploy:
*.csproj + host.json → Azure Functions*.csproj + Dockerfile → Container JobAsk for any parameters not provided as arguments:
rg-graph-intelligence)eastus)az account list --output table)For Container Jobs additionally:
az --version 2>/dev/null | head -1
az account show --query "{name:name, id:id, tenantId:tenantId}" -o json
func --version 2>/dev/null # only for Functions
docker --version 2>/dev/null # only for Container Jobs
If not logged in: print az login and pause.
Check if infra/main.bicep exists. If not, write it for the selected project type (see reference).
# Create resource group if needed
az group create --name {resource-group} --location {location}
# Deploy Bicep template
az deployment group create \
--resource-group {resource-group} \
--template-file infra/main.bicep \
--parameters infra/main.bicepparam \
--name "deploy-$(date +%Y%m%d-%H%M%S)"
Capture and display outputs (Function App name, principal ID, ACR login server, etc.).
# Build release
dotnet publish -c Release -o ./publish
# Deploy
func azure functionapp publish {function-app-name} --dotnet-isolated
# Verify — list functions
az functionapp function list \
--name {function-app-name} \
--resource-group {resource-group} \
--query "[].{name:name, invokeUrl:invokeUrlTemplate}" -o table
# Build and push to ACR
az acr build \
--registry {acr-name} \
--image graph-scan-job:{git-sha} \
--image graph-scan-job:latest \
.
# Update Container App Job image
az containerapp job update \
--name {job-name} \
--resource-group {resource-group} \
--image {acr-name}.azurecr.io/graph-scan-job:latest
After infrastructure is provisioned, assign the required Graph app roles to the Managed Identity:
PRINCIPAL_ID=$(az deployment group show \
--resource-group {resource-group} \
--name "deploy-..." \
--query properties.outputs.principalId.value -o tsv)
# Assign roles based on operations used
./infra/assign-graph-roles.sh "$PRINCIPAL_ID" \
Sites.Read.All Files.Read.All User.Read.All
If assign-graph-roles.sh doesn't exist, write it inline.
Show the role assignments and confirm they applied:
az rest --method GET \
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/{principalId}/appRoleAssignments" \
--query "value[].{role:appRoleId}" -o table
Ask for CI/CD system if not provided:
GitHub Actions: write .github/workflows/deploy.yml (OIDC, no secrets):
az ad app federated-credential create --id {client-id} \
--parameters '{"name":"github-main","issuer":"https://token.actions.githubusercontent.com","subject":"repo:{owner}/{repo}:ref:refs/heads/main","audiences":["api://AzureADTokenExchange"]}'
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_IDAzure DevOps: write azure-pipelines.yml with service connection name placeholder.
curl -X POST "https://{app}.azurewebsites.net/api/TriggerScan/site/{siteId}?code={key}"az containerapp job start --name {job} --resource-group {rg}Check logs:
# Functions
az webapp log tail --name {function-app-name} --resource-group {resource-group}
# Container Job
az containerapp job execution list \
--name {job-name} --resource-group {resource-group} \
--query "[0].{name:name, status:properties.status}" -o table
## Deployment Complete
| Resource | Name | Status |
|---------|------|--------|
| Resource Group | {rg} | Created |
| Function App / ACA Job | {name} | Deployed |
| ACR (Container Job) | {name} | Image pushed |
| Managed Identity | {name} | Graph roles assigned |
| CI/CD Pipeline | GitHub Actions / ADO | Written |
Graph permissions assigned:
✓ Sites.Read.All
✓ Files.Read.All
✓ User.Read.All
### URLs
- Function app: https://{app}.azurewebsites.net
- Application Insights: https://portal.azure.com/#resource/...
--functions: Deploy as Azure Functions (skip project type question)--container-job: Deploy as Azure Container Job--resource-group <name>: Target resource group--location <region>: Azure region (default: eastus)--no-infra: Skip Bicep provisioning (assume resources already exist)--no-cicd: Skip CI/CD pipeline generation--dry-run: Show all planned commands without executingWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
5 commands in this plugin
/add-graph-operationazure-graph-dotnet:add-graph-operationAdd a specific Microsoft Graph operation to an existing C# project — generates a service class, interface, model records, and DI registration for delta scan, metadata PATCH, file moves, or custom Graph calls./dotnet-setupazure-graph-dotnet:dotnet-setupInteractive setup wizard for C# / .NET Azure Graph projects — checks prerequisites, selects hosting model, configures Azure Identity, validates toolchain, and writes appsettings / local.settings files./scaffold-consoleazure-graph-dotnet:scaffold-consoleScaffold a .NET 8 console app / Azure Container Job for long-running batch Graph operations — generic host, BackgroundService worker, Dockerfile, ACA Job Bicep, and Managed Identity role assignment script./scaffold-functionazure-graph-dotnet:scaffold-functionScaffold a new Azure Function class for a specific Graph operation — timer, HTTP, or Durable trigger — with DI wiring, resilience pipeline, logging, and cancellation token support.npx claudepluginhub thelobbi/claude-m --plugin azure-graph-dotnetOther plugins' commands for the same job