
Our goal in this posting is to connect a supported DevOps environment to Defender for Cloud, verify inventory and posture visibility, select a supported scanning path, and validate that security findings can be remediated in the developer workflow.
Cloud risk often starts before a resource is deployed. Hardcoded credentials, vulnerable dependencies, insecure application code, and permissive infrastructure-as-code can all move from a repository into production if repository security is disconnected from cloud posture.
Microsoft currently calls this experience DevOps security in Defender for Cloud. The connector gives the security team centralized inventory and posture visibility, while code, secret, dependency, and IaC findings come from supported scanning capabilities such as agentless code scanning, Microsoft Security DevOps, GitHub Advanced Security, GitHub Advanced Security for Azure DevOps, or GitLab security features.
| Note: A DevOps connector is not the same thing as a scanner. Treat onboarding as two layers: connect the environment first, then verify which scanner or platform security product supplies each finding type. Azure DevOps and GitHub also support agentless code scanning in public preview as of August 2026. |

Figure 1. Updated code-to-cloud flow: connection establishes visibility; scanning supplies the findings.
Why build this
DevOps security is useful when the security team needs repository context next to cloud risk. Defender for Cloud can inventory connected DevOps resources, assess DevOps configuration, surface supported security findings, and – with Defender CSPM – add code-to-cloud context for prioritization.
Start with a non-critical repository or a narrowly scoped project. That gives you a safe place to validate connector permissions, scan coverage, finding volume, and developer feedback before expanding to a larger organization or group.
Security outcome
- Connected repositories and projects are visible in the Defender for Cloud DevOps security experience.
- Repository posture findings are separated from scanner-generated code, IaC, dependency, and secret findings.
- Security teams can correlate repository risk with deployed cloud resources when Defender CSPM code-to-cloud capabilities are enabled and the required mapping data exists.
- Developers receive findings through the source-control workflow where the selected platform and scanning path support that experience.
What you will deploy or configure
- A native Defender for Cloud DevOps connector for Azure DevOps, GitHub, or GitLab SaaS.
- Repository or project inventory and DevOps posture recommendations in Defender for Cloud.
- A supported scan source: agentless code scanning (Preview), Microsoft Security DevOps, GitHub Advanced Security / GitHub Advanced Security for Azure DevOps, or GitLab Ultimate security scanning.
- Pull request annotations only where the provider, Defender plan, and scan path support them.
- An ownership and remediation workflow for at least one finding.
| Microsoft baseline: Do not treat a connected repository as a scanned repository. Document which product generates code, IaC, dependency, and secret findings for every pilot repository. |
| Special highlight: For testing, use synthetic findings only. Never commit real credentials. A disposable repository with intentionally insecure sample IaC and non-secret test data is safer for validating workflows. |
Prerequisites
- An Azure subscription with Microsoft Defender for Cloud onboarded and a DevOps connector region supported by Microsoft.
- Azure permission to create the connector: Subscription Contributor or Security Admin. Security Reader is sufficient for read-only review at the resource-group or connector scope.
- A named developer or platform owner for the pilot repository and a defined remediation path.
Provider-specific access
- Azure DevOps: Project Collection Administrator on the target organization, Basic or Basic + Test Plans access (Stakeholder is not sufficient), and third-party application access via OAuth enabled. Microsoft recommends a dedicated connector identity rather than a personal account.
- GitHub: Organization Owner for the organization being connected. Additional GitHub Advanced Security licensing is required for private/internal repositories when you depend on Code Security or Secret Protection features.
- GitLab: Group Owner on the target group. Microsoft’s current GitLab onboarding documentation lists GitLab Ultimate as a prerequisite.
Platform capability quick reference
| Platform | Connect / inventory | How findings reach Defender for Cloud | Pull request / merge request annotations |
| Azure DevOps | Yes | Agentless code scanning (Preview); Microsoft Security DevOps extension; GHAzDO for secrets, dependencies, and CodeQL findings | Defender PR annotations require Defender CSPM + MSDO; Defender currently supports IaC findings only |
| GitHub | Yes | Agentless code scanning (Preview); Microsoft Security DevOps GitHub action; GitHub Advanced Security | Supported with GitHub Advanced Security and the MSDO workflow; configure the workflow for pull_request events |
| GitLab SaaS | Yes; GitLab Ultimate prerequisite | Supported GitLab Ultimate security findings are surfaced in Defender for Cloud | Not supported by the Defender integration |
Inventory field note: Advanced security status is currently shown for Azure DevOps and GitHub repositories. Pull request annotation status in the Defender inventory is currently shown only for Azure DevOps.
Before-state checklist
Capture the current DevOps and Defender configuration before onboarding. This makes screenshots more useful and gives the pilot a clean rollback reference.
- Record whether Foundational CSPM or Defender CSPM is enabled in the tenant and which advanced features the pilot expects to use.
- Record existing DevOps connectors, connector identities, and source-control security products already enabled for the pilot repositories.
- Record the current default branch, build-validation policy, and relevant pipeline or workflow used for security scanning.
- Capture current Defender recommendations and source-platform security findings so new evidence is not confused with pre-existing results.
Lab build
Use one pilot repository with an active owner. The exact source-control scope differs by provider, but the onboarding path starts in Defender for Cloud Environment settings.
- Choose a pilot repository that contains application code or infrastructure-as-code and has an owner who can review and remediate findings.
- In the Azure portal, go to Microsoft Defender for Cloud > Environment settings > Add environment, and select Azure DevOps, GitHub, or GitLab.
- Enter the connector name, Azure subscription, resource group, and a supported region. Authorize the provider with the required platform administrator account. For Azure DevOps, prefer a dedicated service account with the minimum permissions required by the connector.
- After the connector is created, open Defender for Cloud > DevOps security and confirm that the expected repositories or projects appear in inventory.
- Choose and configure the scan path for the pilot. Do not assume that the connector alone will generate code, secret, dependency, or IaC findings.
- Run or wait for the selected scanner, then confirm at least one supported finding appears in Defender for Cloud and maps to the expected repository.
- If pull request annotations are in scope, validate the provider-specific prerequisites before enabling them.
- Fix one finding in a branch, complete the normal review process, rerun or wait for the scanner, and confirm the finding is resolved or updated in Defender for Cloud.
Choose the scan path
- Agentless code scanning (Preview) – Azure DevOps and GitHub only. It scans the default branch for code vulnerabilities, IaC misconfigurations, and open-source dependency vulnerabilities without pipeline changes. It also generates an SBOM for query scenarios. Scans run after enablement and then daily.
- Microsoft Security DevOps – use the Azure DevOps extension or GitHub action when you want scanning during CI/CD. Pipeline scanning can cover more artifact types and can be configured to fail a build based on severity. For Azure DevOps integration, publish SARIF to the CodeAnalysisLogs artifact.
- Platform advanced security – use GitHub Advanced Security / GHAzDO for secrets and dependency findings, and for CodeQL where appropriate. Microsoft Security DevOps CredScan secret scanning was deprecated; do not design a new Azure DevOps secret-scanning workflow around MSDO CredScan.
- GitLab – Defender for Cloud surfaces supported GitLab security findings from GitLab Ultimate. Agentless code scanning and Defender merge-request annotations are not currently available for GitLab.
| Agentless preview limits: As of August 2026, agentless code scanning supports Azure DevOps and GitHub connectors in selected regions, scans only the default branch, supports repositories under 1 GB, does not perform binary scanning, and cannot break builds. Use in-pipeline scanning when you need per-build enforcement or broader artifact coverage. |
Pull request annotation checks
- Azure DevOps: Defender CSPM is required for Defender PR annotations. Microsoft Security DevOps must be configured, the main branch needs a Build Validation policy for the CI build, and Defender currently annotates IaC findings only.
- GitHub: GitHub Advanced Security and the Microsoft Security DevOps workflow are prerequisites in Microsoft’s Defender guidance. Configure the workflow to run on pull_request for the target branch.
- GitLab: Defender for Cloud does not add inline annotations to GitLab merge requests.
Pilot scope and change control
- Document the connector identity and authorization method. In Azure DevOps, connector activity is attributed to the authorizing identity in audit logs and PR timelines.
- For large Azure DevOps organizations, remember that Defender for Cloud API calls count against the Azure DevOps global consumption limit; discovery can be slower and throttling can occur.
- Keep the first scan scope narrow enough that the development team can triage the resulting backlog. Expand after severity thresholds, owners, and exception handling are agreed.
- Microsoft recommends only one instance of a given Azure DevOps organization, GitHub organization, or GitLab group be onboarded to the Azure tenant when you rely on advanced DevOps posture capabilities.
Reader copy/paste block
Use this as a change-ticket or pilot checklist. Replace the provider-specific items that do not apply.
# Defender for Cloud DevOps security – pilot checklist
# [ ] Connector created in a supported region
# [ ] Expected repositories/projects visible in DevOps security inventory
# [ ] Scan source selected: agentless preview | MSDO | GHAS/GHAzDO | GitLab Ultimate
# [ ] Secret-scanning source confirmed; no dependency on deprecated MSDO CredScan
# [ ] At least one supported finding visible in Defender for Cloud
# [ ] PR annotation compatibility confirmed for this provider and finding type
# [ ] One finding remediated and verified after rescan/build
# [ ] Owner, severity threshold, exception path, and review cadence documented
Production hardening
For production, combine the connector, the chosen scan source, and a developer remediation path. The connector centralizes visibility; it should not become a passive dashboard that nobody owns.
- Use a dedicated Azure DevOps connector identity where practical, document its required permissions, and review the account lifecycle like any other service identity.
- Choose agentless scanning for broad scheduled coverage and pipeline scanning when you need build-time feedback, binary/container analysis, or build-fail criteria. They can complement each other.
- Use GitHub Advanced Security, GHAzDO, or GitLab security features for secret scanning rather than relying on the deprecated MSDO CredScan path.
- If code-to-cloud contextualization is a requirement, enable Defender CSPM and ensure the relevant mapping data is produced. Container and IaC mapping capabilities have additional pipeline prerequisites.
- Route recommendations to a named engineering owner. Define severity thresholds, due dates, and an exception process with owner, expiry date, business justification, and compensating controls.
- Send evidence and ownership data into the existing security-operations or application-security workflow instead of creating an isolated review process.
Operational handoff
- Review connector health, repository coverage, scanner coverage, and finding ownership on a recurring cadence.
- Track repositories that are connected but not scanned, and repositories whose advanced-security features are partially enabled.
- Store the validation checklist, scanner configuration, expected data latency, and cleanup steps with the service runbook.
- Review platform licensing and Defender CSPM coverage when onboarding new business units or source-control organizations.
Finished-state validation
| Control | Expected result | Evidence to capture |
| Connector | DevOps environment is connected in the intended Azure subscription/resource group | Environment settings |
| Inventory | Pilot repository/project appears in Defender for Cloud | DevOps security inventory |
| Posture | DevOps configuration recommendations are visible | Security recommendations |
| Scan source | Agentless, MSDO, or platform advanced security is explicitly configured | Connector / pipeline / repository settings |
| Findings | At least one supported finding is visible from the selected scanner | Recommendation or finding details |
| Annotations | Provider-specific behavior matches the support matrix; GitLab is N/A | Pull request or documented N/A |
| Remediation | Finding changes state after the fix and the next scan/build | PR + Defender finding history |
| Ownership | Developer and security owners, severity threshold, and exception path are documented | Runbook / work item |
Cost and licensing notes
The DevOps connector and core inventory/posture experience are available with Foundational CSPM. Defender CSPM adds advanced DevOps capabilities such as code-to-cloud contextualization, Security Explorer, attack path analysis, and Defender pull request annotations for IaC findings.
Use caution with policy changes in MDC, ensure that the scope is accurately configured and services are only being enabled on the intended subscriptions, management groups, and resources.
- Defender CSPM is billed based on supported cloud resource counts rather than repository count. Check the current Defender for Cloud pricing page before publication because rates and billing rules can change.
- GitHub Advanced Security and GitHub Advanced Security for Azure DevOps are separately licensed platform capabilities. In Azure DevOps, the current product model separates Secret Protection and Code Security features.
- Microsoft’s current GitLab connector guidance requires GitLab Ultimate for the group being connected.
- Agentless code scanning is currently a public-preview capability for Azure DevOps and GitHub; preview terms and regional availability should be rechecked before a production commitment.
Known limitations and edge cases
- Azure DevOps onboarding supports Git repositories (TfsGit). TFVC repositories are not supported by Defender for Cloud DevOps security.
- GitHub Enterprise Cloud instances configured with data residency are not currently supported by Defender for Cloud DevOps security.
- Agentless code scanning (Preview) is limited to Azure DevOps and GitHub, selected regions, the default branch, repositories under 1 GB, and scheduled daily scans. It does not scan binaries and cannot fail builds.
- Defender PR annotations in Azure DevOps currently support IaC findings only. GitLab merge-request annotations are not supported by the Defender integration.
- Advanced security status in the Defender inventory is currently available for Azure DevOps and GitHub repositories; PR annotation status is currently available only for Azure DevOps repositories.
- Recommendation exemptions are not currently available for DevOps security recommendations in Defender for Cloud.
Troubleshooting
In the case that the integration and configuration run into some real-life challenges, you can try the following for quick fixes:
- Connector fails or an organization is missing: verify the provider admin role, the Azure connector-creation role, the signed-in tenant, and provider prerequisites. For Azure DevOps, confirm Project Collection Administrator + Basic access and OAuth third-party application access.
- Azure DevOps repository is missing: confirm it is a TfsGit repository and that the Azure subscription and Azure DevOps organization are associated with the correct tenant/account used to authorize the connector.
- Repository is connected but findings are empty: confirm the selected scanner actually ran. A connector alone does not guarantee code, dependency, secret, or IaC findings.
- Azure DevOps MSDO results are missing: verify the Microsoft Security DevOps task ran and that SARIF is published to the CodeAnalysisLogs artifact expected by Defender for Cloud.
- Agentless results are missing: verify the connector region is supported, the repository is under 1 GB, and the expected code is on the default branch. Initial scans typically take minutes, but the ongoing scan cadence is daily.
- PR annotations do not appear: verify the platform-specific prerequisites. In Azure DevOps, check Defender CSPM, MSDO, main-branch Build Validation, and that the finding is IaC. In GitHub, verify GitHub Advanced Security and the pull_request workflow. GitLab annotations are not supported.
- Large Azure DevOps environment is slow to discover: Defender API calls count toward Azure DevOps global consumption limits; use a dedicated connector identity and allow for throttling/discovery time.
Rollback or cleanup
- For a lab, remove or disable the pilot connector after screenshots and validation if the environment should not remain onboarded.
- If agentless code scanning was enabled, disable it or narrow its scope as appropriate. Remember that source-platform security features such as GitHub Advanced Security or GHAzDO are independent controls and are not automatically removed with the Defender connector.
- If a dedicated Azure DevOps service account, GitHub application authorization, or pipeline extension/action was created only for the pilot, revoke or remove it through normal change control when it is no longer required.
- Preserve the validation evidence and audit trail before removing connectors or scanner configuration.
