Share via

Repo level CodeQL default setup is not persisting in Azure Repos

Kayla 0 Reputation points
2026-06-01T18:17:40.64+00:00

Now that GitHub Advanced Security for DevOps can have a basic CodeQL setup at the org/proj/repo level instead of only writing YML pipes, I was trying to enable that for my instance. I was able to configure the pool and schedule at the org level and set it to enabled for new projects, and within the project, I'm able to set it to enabled for new repos.

My issue is getting existing repos to have a CodeQL analysis with the default setup. When I click the checkbox, everything is fine, but if I navigate away and come back, the box is unchecked.

From looking at the network tab in DevTools, the initial state of my repo is codeQLEnabled: null

Then, checking the box does a PATCH with a payload of { "advSecEnablementFeatures": { "codeQLEnabled": true } }
It gets back a 204 No Content
After refreshing the repo settings page, the state of the settings is still codeQLEnabled: null

The advSecEnablementLastChangedDate changes after the PATCH, which suggests the request actually is accepted or processed, but the CodeQL field isn't working. The other repo adv sec settings, like blocking secrets on push and scanning the default branch for dependencies, still work, as does selecting CodeQL's View Details and manually triggering a run. This occurs on repos that have had previous YML CodeQL runs and those that have not.

Azure DevOps

1 answer

Sort by: Most helpful
  1. AI answer

    2026-06-01T18:18:10.2+00:00

    CodeQL default setup for GitHub Advanced Security in Azure DevOps is currently in preview and is still rolling out, and the behavior described matches a backend limitation/bug rather than a configuration issue.

    From the documented behavior:

    • CodeQL default setup is a managed, organization-level feature that runs using Azure Pipelines and is configured centrally for agent pool and schedule at Organization settings → Repositories → CodeQL default setup configurable options.
    • Default setup is designed to be the quickest way to enable code scanning and runs on a weekly schedule, surfacing results in the Advanced Security tab.
    • The feature has been in private preview and then public preview, and Microsoft has explicitly called out rollout issues and delays:
      • CodeQL default setup (one‑click enablement) was initially in private preview.
      • Later release notes state that the rollout of CodeQL default setup has been delayed due to issues discovered during rollout, and the team is working to resolve them.

    Given this:

    1. The organization-level configuration (agent pool, schedule, enable for new projects/repos) working, while repo-level toggling for existing repos does not persist, is consistent with an incomplete or problematic rollout of the default setup feature.
    2. The fact that advSecEnablementLastChangedDate updates but codeQLEnabled remains null, despite a 204 response, indicates that the server is accepting the request but not committing the CodeQL default setup state for that repo. This aligns with the known rollout issues mentioned in the release notes.
    3. Other Advanced Security features (secret scanning, dependency scanning, manual CodeQL runs via “View Details”) working confirms that Advanced Security itself is enabled and that the problem is specific to CodeQL default setup persistence.

    Workable paths based on the documented options:

    1. Use Advanced setup for CodeQL in affected repos
      • Configure CodeQL via pipelines using the Advanced Security CodeQL tasks (AdvancedSecurity-CodeQL-Init@1 and AdvancedSecurity-Codeql-Analyze@1) as described under advanced setup. This gives full control and does not depend on the default setup toggle.
      • Note that the CodeQL autobuild task is deprecated; use buildtype: none in AdvancedSecurity-CodeQL-Init@1 instead.
    2. Continue using default setup only where it persists (e.g., new repos)
      • Since default setup is recommended as the starting point and is centrally configured, allow it to manage new repositories where the toggle is applied automatically from org/project settings.
    3. Treat the non‑persisting toggle as a product issue
      • Because Microsoft has acknowledged rollout issues and even delayed the rollout of CodeQL default setup, the non‑persisting codeQLEnabled flag for existing repos is best handled as a service-side bug rather than further client-side troubleshooting.
      • For production needs, rely on advanced setup until the rollout issues are resolved and default setup is fully supported for existing repositories.

    In short, the behavior is a limitation/bug in the current preview rollout of CodeQL default setup. Use advanced setup for existing repos that need reliable CodeQL scanning, and rely on default setup only where it is automatically and correctly applied.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.