| title | Publish Cargo packages from the command line |
|---|---|
| description | Learn how to connect to your feed and publish your Cargo packages from the command line. |
| ms.service | azure-devops-artifacts |
| ms.topic | how-to |
| ms.date | 03/25/2025 |
| monikerRange | >= azure-devops-2022 |
[!INCLUDE version-lt-eq-azure-devops]
This article walks you through setting up your project, authenticating with your Azure Artifacts feed, and publishing Cargo packages from the command line.
| Product | Requirements |
|---|---|
| Azure DevOps | - An Azure DevOps organization. - An Azure DevOps project. - Download and install rustup. You'll need Cargo version 1.74.0 or later. |
Azure Artifacts recommends using a dedicated feed for consuming crates from crates.io and a separate feed for publishing your internal crates. If you already have an Azure Artifacts feed, skip to the next section. Otherwise, create a new feed as follows:
-
Sign in to your Azure DevOps organization, and then navigate to your project.
-
Select Artifacts, and then select Create Feed.
-
Enter a Name for your feed and specify its Visibility. If you want to include packages from public registries, check Upstream sources, then select a Scope for your feed.
-
Select Create when you're done.
:::image type="content" source="media/cargo-create-a-feed.png" alt-text="A screenshot displaying how to create a new feed in Azure Artifacts.":::
-
If you haven't authenticated with your feed yet, follow the steps in the Project setup to configure your config files, set up a credential provider, and log in to the registry.
-
Run the following command in your project directory to publish your Cargo package:
cargo publish