You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finding the right package for your project can be challenging, especially when there are many versions and dependencies involved. In this article, learn how to use Code Search to perform functional package search in Azure DevOps, which allows you to search for packages based on their functionality, metadata, and code snippets.
18
+
Finding the right package for your project can be time-consuming, especially when you're managing multiple feeds, versions, and dependencies. In this article, you learn how to use Azure DevOps Code Search to perform functional package searches across all your feeds to help you locate your packages based on functionality, versions, or type.
19
19
20
20
## Prerequisites
21
21
22
-
| Category | Requirements |
23
-
|--------------|-------------|
24
-
|**Azure DevOps organization and project**| An [organization](../../organizations/accounts/create-organization.md) and a [project](../../organizations/projects/create-project.md#create-a-project). |
25
-
|**Azure Artifacts feed**| An [Azure Artifacts feed](../../artifacts/get-started-nuget.md#create-a-feed). |
22
+
|**Product**|**Requirements**|
23
+
|--------------------|-------------------|
24
+
|**Azure DevOps**| - An Azure DevOps [organization](../../organizations/accounts/create-organization.md).<br>- An Azure DevOps [project](../../organizations/projects/create-project.md).<br> - An Azure Artifacts [feed](../../artifacts/start-using-azure-artifacts.md#create-a-new-feed). |
26
25
27
26
## Search packages
28
27
29
-
1. Sign in to your project (```https://dev.azure.com/{Your_Organization}/{Your_Project}```).
30
-
2. Enter `package` in the search box.
31
-
3. Select from the dropdown menus to search by feeds, views, or package types.
28
+
Azure DevOps code search lets you search all feeds in your organization, regardless of the project you’re in.
32
29
33
-
:::image type="content" source="media/shared/package-search-results-filters.png" alt-text="Screenshot showing the filter panel options.":::
30
+
1. Sign in to your Azure DevOps organization and navigate to your project (`https://dev.azure.com/{Your_Organization}/{Your_Project}`).
34
31
35
-
You can search within all feeds of the organization by default, regardless of the project you’re in.
32
+
1. In the search bar, enter a term (for example, time) in the search box and press Enter. This returns any package with the term "time" in its name or description.
36
33
37
-
The **Views**filter shows up only when you select a single feed from the **Feeds**filter. This filter lets you display packages from a particular view.
34
+
1. Select the **Package**tab to view all search results. Use the **Feeds**, **Views**, or **Type**dropdown menus to filter results by feed, feed view, or package type (for example, NuGet).
38
35
39
-
You can use the **Type** filter to choose the package type you want to search for (for example, NuGet packages).
36
+
:::image type="content" source="media/shared/package-search-results-filters.png" alt-text="A screenshot displaying how to filter the package search results.":::
40
37
41
-
## Search with the REST API
38
+
> [!NOTE]
39
+
> The **Views** filter appears only when you select a single feed from the **Feeds** filter.
40
+
41
+
## Search for packages using the REST API
42
42
43
-
You can use the Azure DevOps REST API to search for packages in a specific organization. For more information, see [Fetch package search results](/rest/api/azure/devops/search/package-search-results/fetch-package-search-results).
43
+
The Azure DevOps REST API provides an endpoint that allows you to search for packages within a specific organization. The following example demonstrates how to construct the HTTP request and request body to search for the *react-calendar* npm package across all feeds in your organization. See [Fetch package search results](/rest/api/azure/devops/search/package-search-results/fetch-package-search-results) for more details.
44
44
45
-
#### Example
45
+
#### Example:
46
46
47
47
```Command
48
-
POST https://almsearch.dev.azure.com/ORGANIZATION_NAME/_apis/search/packagesearchresults?api-version=7.0
48
+
POST https://almsearch.dev.azure.com/ORGANIZATION_NAME/_apis/search/packagesearchresults?api-version=7.1
49
49
```
50
50
51
51
```Request body
@@ -60,19 +60,30 @@ POST https://almsearch.dev.azure.com/ORGANIZATION_NAME/_apis/search/packagesearc
60
60
}
61
61
```
62
62
63
-
## Search upstream sources
63
+
## Search for packages in upstream sources
64
+
65
+
Azure Artifacts upstream sources enable developers to consume packages from different feeds and public registries such as *NuGet.org*. Using Azure Artifacts, you can search for various types of packages in your upstream sources.
66
+
67
+
1. Sign in to your Azure DevOps collection, and then navigate to your project.
64
68
65
-
Using upstream sources, you can consume packages from public registries and other Azure Artifacts feeds. For more information, see [Search upstream](../../artifacts/how-to/search-upstream.md).
69
+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
70
+
71
+
1. Select **Search Upstream Sources** in the upper-right corner of the page.
72
+
73
+
1. Choose a **Package type** and then enter the exact name in the **Package Name** text box. The package name is case sensitive and must be an exact match.
74
+
75
+
1. Select **Search** to view a list of available versions for the package you searched.
66
76
67
77
> [!NOTE]
68
-
> You can only search for packages in upstream sources from your feed in Azure DevOps Services. NuGet Package Explorer doesn't support searching for upstream packages. For more information, see [Download NuGet packages](../../artifacts/get-started-nuget.md#download-packages-from-your-feed).
78
+
> Searching for packages in upstream sources from your feed is supported only in Azure DevOps services.
69
79
70
80
## Next steps
71
81
72
82
> [!div class="nextstepaction"]
73
83
> [Promote a package to a view](../../artifacts//feeds/views.md)
0 commit comments