Search code examples
gitazureazure-devopsazure-repos

How to search across many Azure Devops Git project and find all files which contain specific text AND which filename contains "Resource"


I am using Azure Devops Repos, where I have around 100 projects. I would like to use the portal and find all files which

  1. have the pattern '*Resource*'
  2. contain the 'email' text in their content

I tried to use this search phrase: "email filename:Resource" enter image description here

But it did not retrieve expected results and I know they exist.


Solution

  • Ensure the Code Search extension has been installed into your Azure DevOps organization.

    Then you can try the search string like as the format "<keywords> file:<pattern>":

    • The '<keywords>' is the keywords to match the content you want to search.
    • The '<pattern>' is the wildcard pattern to match the filename.

    For your case, you can try the search string "email file:*Resource*". Normally, it will return the files that:

    • the filename contains the keyword 'Resource'.
    • and the content/text contains the keyword 'email'.

    For more details, see the following documentations: