title | description | ms.service | ms.topic | ms.author | author | ms.assetid | ms.date | monikerRange | recommendations |
---|---|---|---|---|---|---|---|---|---|
Quickstart: Get started with NuGet packages and Azure Artifacts |
Learn how to use Azure Artifacts to publish and download NuGet packages from your feed. |
azure-devops-artifacts |
quickstart |
rabououn |
ramiMSFT |
C5112218-DA7E-4016-986D-2D0F70DAFA44 |
05/14/2024 |
<= azure-devops |
true |
[!INCLUDE version-lt-eq-azure-devops]
Azure Artifacts enables developers to publish and download NuGet packages from sources such as feeds and public registries. With Azure Artifacts, you can create feeds that are either:
- Private, so you can share packages with your team and specific users.
- Public, so you can share packages openly with anyone on the internet.
In this quickstart, you learn how to:
[!div class="checklist"]
- Create a new feed.
- Set up your project and connect to your feed.
- Publish NuGet packages.
- Download packages from your feed.
-
Create an Azure DevOps organization and a project if you haven't already.
-
Install the latest NuGet version.
-
Install the Azure Artifacts Credential Provider.
::: moniker range="azure-devops"
-
Sign in to your Azure DevOps organization, and then go to your project.
-
Select Artifacts, and then select your feed from the dropdown menu.
-
Select Connect to Feed, and then select NuGet.exe from the left pane. If this is your first time using Azure Artifacts with Nuget.exe, ensure that you installed all the prerequisites.
:::image type="content" source="./media/connect-to-feed-azure-devops-newnav.png" alt-text="Screenshot that shows the button for connecting to a feed.":::
-
Follow the instructions in the Project setup section to configure your nuget.config file and authenticate with Azure Artifacts.
:::image type="content" source="./media/project-setup.png" alt-text="Screenshot that shows onscreen instructions for setting up a project.":::
::: moniker-end
::: moniker range="azure-devops-2020 || azure-devops-2022"
-
Sign in to your Azure DevOps server, and then go to your project.
-
Select Artifacts, and then select your feed from the dropdown menu.
-
Select Connect to Feed, and then select NuGet.exe from the left pane.
-
Follow the instructions in the Project setup section to connect to your feed.
:::image type="content" source="./media/connect-to-feed-nuget-server-2020.png" alt-text="Screenshot that shows onscreen instructions for setting up a NuGet project in Azure DevOps Server 2020 and 2022.":::
::: moniker-end
::: moniker range="azure-devops-2019"
-
Sign in to your Azure DevOps server, and then go to your project.
-
Select Artifacts, and then select your feed from the dropdown menu.
-
Select Connect to Feed, and then select NuGet from the left pane.
-
Follow the instructions to add your package source URL to nuget.config.
:::image type="content" source="./media/connect-to-feed-nuget-server-2019.png" alt-text="Screenshot that shows onscreen instructions for setting up a NuGet project in Azure DevOps Server 2019.":::
::: moniker-end
::: moniker range="azure-devops"
Note
Using NuGet Package Explorer to search for packages in upstream sources is not supported.
::: moniker-end
To publish your package to your feed, run the following command. You can enter any string for the ApiKey
argument.
nuget.exe push -Source <SOURCE_NAME> -ApiKey key <PACKAGE_PATH>
Examples:
-
Project-scoped feed:
nuget.exe push -Source https://pkgs.dev.azure.com/myOrganization/MyProject/_packaging/MyFeed/nuget/v3/index.json -ApiKey AZ release/myDemoPackage.1.0.0.nupkg
-
Organization-scoped feed:
nuget.exe push -Source https://pkgs.dev.azure.com/myOrganization/_packaging/myFeed/nuget/v3/index.json -ApiKey AZ release/myDemoPackage.1.0.0.nupkg
Note
The ApiKey
is required, but you can use any arbitrary value when publishing to Azure Artifacts feeds.