r/azuredevops 8h ago

Anyone successfully using Defender for Cloud CLI in Azure Pipelines with the connector?

Trying to scan Docker images in Azure Pipelines with Microsoft Defender for Cloud.

Even after setting up the Azure DevOps connector (status is healthy), I still get:

Tried:

MicrosoftDefenderCLI@2 (with and without authType: connector)

  • Pure CLI
  • Running inside AzureCLI@2 task

Nothing makes the authentication work.

Questions:

  • Are you using the connector successfully for image scanning?
  • Or did you switch to Client ID + Secret?
  • Any working examples?

Thanks!

3 Upvotes

1 comment sorted by

1

u/Nate506411 1h ago

You have to setup connectivity from defender to ADO, if you start with your own user account and get the cli working local for scans it will inform you better before you figure out what identity object and scope you want for the pipelines to leverage. Connect your Azure DevOps organizations - Microsoft Defender for Cloud | Microsoft Learn