Skip to content

Authentication

The scanner authenticates to Azure DevOps as an identity you choose. Whatever it can read is what Observes sees, so give that identity read access to the projects you want scanned. See Permissions.

Choose a method

Method Secret to manage Scanner option Best for
Workload identity federation None --auth-mode default, with the federated token your platform provides Workloads on platforms that issue federated tokens, such as AKS workload identity. Recommended.
Managed identity None --auth-mode managed-identity Agents and services on Azure compute
Service principal, certificate Certificate --auth-mode service-principal Automation outside Azure
Service principal, secret Client secret --auth-mode service-principal Automation outside Azure, when a certificate isn't an option
Azure CLI sign-in None --auth-mode default, after az login Running the scanner on your machine
PAT Token, up to a year --auth-mode pat Quick local tests

Microsoft recommends Microsoft Entra ID identities over PATs for automation. Their tokens last about an hour and are refreshed automatically, so there's nothing to rotate. However, PATs may give you more granular control over permission scopes.

Give the identity access to Azure DevOps

The identity the scanner uses needs an Azure DevOps licence and read access to the projects you want to scan. How you grant that depends on how access is managed in your organisation.

Identity type What it can see
PAT Whatever the owning user can see. That includes access inherited from Entra ID groups and Azure DevOps permission groups.
Service principal or managed identity Nothing until it is added to the organisation, either directly or through a group.

Choose the option that matches how your organisation manages access.

Option A: Add the identity directly

  1. In Azure DevOps, open Organization settings → Users and select Add users.
  2. Search for the identity's display name, for example observes-scanner.
  3. Set Access level to Basic.
  4. Under Add to projects, select the projects to scan, then select Add.

If your organisation syncs Entra ID groups into Azure DevOps and assigns access with group rules or permission groups, add the identity to a group that already has the right access. This avoids a one-off assignment that sits outside your normal process.

  1. In Microsoft Entra ID, add the identity as a member of a security group that is already synced to Azure DevOps, or create a dedicated one such as sg-observes-scanner. Service principals and managed identities can be members of security groups.
  2. In Azure DevOps, confirm the group grants what the scanner needs:
  3. Licence: under Organization settings → Users → Group rules, the group has an access level of Basic (or higher) and is added to the projects to scan.
  4. Permissions: under Project settings → Permissions, the group (or a built-in group such as Readers) has read access to the projects, repositories and pipelines.
  5. Wait for the group membership to sync. This can take some time, and new members may not appear straight away.
  6. Check the result under Organization settings → Users. The identity should appear with the expected access level, and the assignment source should show a group rule rather than a direct assignment.

Check before relying on a group

  • Nested groups: don't assume membership is resolved through nested Entra ID groups. Add the identity to the group that Azure DevOps actually knows about, or confirm nesting works in your tenant.
  • Overlapping access: the identity's effective access is the combination of direct assignments and every group it belongs to. A broad group (for example, one that grants write access) will give the scanner more than it needs.
  • Least privilege: use a dedicated group for the scanner where you can, so read-only access is easy to audit.

Finding the identity

The organisation must be connected to the Microsoft Entra ID tenant the identity lives in. If the search doesn't find the identity, use its object (principal) ID, not its client ID.

For a managed identity:

az identity show --name observes-scanner --resource-group rg-observes --query principalId -o tsv

For a service principal:

az ad sp show --id <client-id> --query id -o tsv

For a group:

az ad group show --group "sg-observes-scanner" --query id -o tsv

Run the scanner

Choose a mode with --auth-mode. Keep every secret in a secret store, and pass it to the scanner in an environment variable: command-line arguments can end up in logs and shell history. The CLI reference has a command for each method.

How default credentials are found

--auth-mode default is what the scanner uses when you don't pass --auth-mode. It uses DefaultAzureCredential, which tries these sources in order and uses the first that works:

  1. Environment variables: AZURE_TENANT_ID and AZURE_CLIENT_ID, with AZURE_CLIENT_SECRET or AZURE_CLIENT_CERTIFICATE_PATH
  2. Workload identity, for example the AKS workload identity webhook
  3. Managed identity, on Azure compute
  4. The Azure CLI session, after az login on your machine