Skip to content

Commit 899ae31

Browse files
committed
moniker
1 parent 07eb1af commit 899ae31

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/artifacts/cargo/cargo-upstream-source.md

+38
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Azure Artifacts recommends having a dedicated feed for consuming crates from cra
4747

4848
## Connect to your feed
4949

50+
::: moniker range="azure-devops"
51+
5052
#### [Private feed](#tab/privatefeed/)
5153

5254
1. Sign in to your Azure DevOps organization, and then navigate to your project.
@@ -122,6 +124,42 @@ Azure Artifacts recommends having a dedicated feed for consuming crates from cra
122124
```
123125
>
124126
127+
::: moniker-end
128+
129+
::: moniker range="azure-devops-2022"
130+
131+
1. Sign in to your Azure DevOps collection, and then navigate to your project.
132+
133+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
134+
135+
1. Select **Connect to feed**, and then select **Cargo** from the left navigation pane.
136+
137+
1. If this is the first time using Cargo with Azure Artifacts, make sure you have installed [rustup](https://rustup.rs/).
138+
139+
1. Add the provided snippet from the **Project setup** section to your *.cargo/config.toml* file in your source repository:
140+
141+
- **Project-scoped feed**:
142+
143+
```
144+
[registries]
145+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<COLLECTION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
146+
147+
[source.crates-io]
148+
replace-with = "<FEED_NAME>"
149+
```
150+
151+
- **Collection-scoped feed**:
152+
153+
```
154+
[registries]
155+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<COLLECTION_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
156+
157+
[source.crates-io]
158+
replace-with = "<FEED_NAME>"
159+
```
160+
161+
::: moniker-end
162+
125163
## Configure a credential provider
126164
127165
To use Cargo with Azure Artifacts, you need to set up a credential provider. The provided settings will configure a default credential helper for the current user:

0 commit comments

Comments
 (0)