# Azure DevOps Service Connection Scope Checker

> Reviews exported Azure DevOps service connections, pipeline permissions and YAML for broad scope: management group or subscription-wide Azure connections, connections open to all pipelines, secret-based service principals, shared connections, and production connections used on pull requests.

Azure DevOps Service Connection Scope Checker is a paid AI agent skill on Agensi by Abdelrhman Fikri, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9.99 (one-time purchase)
- Creator: [Abdelrhman Fikri](https://www.agensi.io/creators/abdelrhman-fikri)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/azure-devops-service-connection-scope-checker
- Tags: security, devops, code-review, azure-devops, service-connection, pipelines, workload-identity, least-privilege

## What it does

- Reads service connection JSON exported from Azure DevOps and the matching pipeline permissions JSON
- Flags management group scope, and broad or production-named connections open to all pipelines, as blockers
- Warns about subscription scope, service principal secrets, shared or unready connections, long-lived tokens
- Reads pipeline YAML and blocks pull-request pipelines that use a broad or production connection
- Warns about addSpnToEnvironment, az login, no-environment production use, unresolved or unused connections

## Who it's for

- **Platform and DevOps engineers:** who own Azure DevOps projects and Azure access.
- **Security reviewers and auditors:** preparing for an audit of what pipelines can do in Azure. Try: "Scan these exported JSON connection lists and tell me which ones use old secrets instead of identity federation."

## About this skill

A service connection is a key to your Azure subscription that every pipeline author can ask to use. The usual problems are quiet: a connection scoped to a whole subscription or management group, a connection authorized for all pipelines, a pull-request pipeline that can reach production, and a client secret that nobody has rotated. This skill gives your agent a deterministic, offline review of all of that from files you export.

The checker is a single standard-library script. It does not connect to Azure DevOps or Azure and never changes a connection. It reads the service connection list (the JSON that az devops service-endpoint list or the REST API returns), optional pipeline permission responses for each connection, and your pipeline YAML. Management group scope is a blocker. A connection that is authorized for all pipelines is a blocker when its scope is broad or its name says production, and a warning otherwise. A service principal secret, a subscription-wide scope, a shared connection, a connection that is not ready and long-lived credential schemes such as personal access tokens are warnings. In YAML it finds the connection each task uses, blocks pull-request pipelines that use a broad or production connection, and warns about addSpnToEnvironment, az login with its own credentials, production connections without an environment, unresolved names and unused connections.

Synthetic example files with expected output are included so you can verify the behaviour in seconds.

## Known limitations

- It reads exported files only; it cannot see Azure role assignments, so it cannot tell what a connection can actually do in Azure.
- The expected JSON shape follows the service endpoint and pipeline permissions responses; if your export differs, fields may be missed.
- YAML is read line by line; templates, variables and expressions are not resolved, and pull-request settings that live in the UI are invisible.
- Environment approvals and checks are not visible in the files; the skill only notes that no environment is used.
- Reports and explains; it never edits connections or pipelines.

## Technical details

The checker is a single standard-library Python script. It makes no network calls and never writes files. Give it files or directories; it reads .json, .yml and .yaml.

Connection JSON is a list, or an object with a value list, of service endpoints (name, type, authorization scheme, data scope level, isShared, isReady, project references). Permission JSON is the pipeline permissions response (resource id, allPipelines authorized, pipelines), matched to a connection by id or name. Resource group scope is recognised from the scope parameter or a ResourceGroup scope level.

YAML is read line by line: connection names under azureSubscription, azureResourceManagerConnection, connectedServiceName, connectedServiceNameARM, serviceConnection, backendServiceArm and environmentServiceNameAzureRM; the pr trigger; deployment and environment keys; addSpnToEnvironment; and az login service principal commands. Names built from variables or template expressions are not resolved. A production name means prod, production or prd as a whole word in the connection name.

Exit codes: 0 no blockers, 1 blockers found, 2 bad arguments. Options: --format json, --hide-info.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Azure DevOps Service Connection Scope Checker skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it need an Azure DevOps token or login?

No. It reads files you export.

### Which files should I export?

The service connection list, the pipeline permissions response for each connection if you can get it, and the pipeline YAML.

### Does it print credentials?

No. Findings name the connection and the problem only.

### Which Python?

Python 3.9 or newer, no packages to install.

### What does exit code 1 mean?

One or more BLOCKER findings. Warnings alone still exit 0.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
