Skip to content

Commit c4d33e3

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
Learn Build Service GitHub App
authored and
Learn Build Service GitHub App
committed
Merging changes synced from https://github.com/MicrosoftDocs/azure-devops-docs-pr (branch live)
2 parents 07c9728 + 0043ea8 commit c4d33e3

File tree

2 files changed

+89
-15
lines changed

2 files changed

+89
-15
lines changed

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

+87-15
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ 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+
52+
#### [Private feed](#tab/privatefeed/)
53+
5054
1. Sign in to your Azure DevOps organization, and then navigate to your project.
5155

5256
1. Select **Artifacts**, and then select your feed from the dropdown menu.
@@ -55,27 +59,95 @@ Azure Artifacts recommends having a dedicated feed for consuming crates from cra
5559

5660
1. If this is the first time using Cargo with Azure Artifacts, make sure you have installed [rustup](https://rustup.rs/).
5761

58-
1. Add the provided snippet in the **Project setup** section to your *.cargo/config.toml* file in your source repository:
62+
1. Add the provided snippet from the **Project setup** section to your *.cargo/config.toml* file in your source repository:
5963

60-
- Project-scoped feed:
64+
- **Project-scoped feed**:
6165

62-
```
63-
[registries]
64-
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
66+
```
67+
[registries]
68+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
69+
70+
[source.crates-io]
71+
replace-with = "<FEED_NAME>"
72+
```
73+
74+
- **Organization-scoped feed**:
6575
66-
[source.crates-io]
67-
replace-with = "<FEED_NAME>"
68-
```
76+
```
77+
[registries]
78+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
79+
80+
[source.crates-io]
81+
replace-with = "<FEED_NAME>"
82+
```
6983
70-
- Organization-scoped feed:
84+
#### [Public feed](#tab/publicfeed/)
85+
86+
1. Sign in to your Azure DevOps organization, and then navigate to your project.
87+
88+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
89+
90+
1. Select **Connect to feed**, and then select **Cargo** from the left navigation pane.
91+
92+
1. If this is the first time using Cargo with Azure Artifacts, make sure you have installed [rustup](https://rustup.rs/).
93+
94+
1. Add the provided snippet from the **Project setup** section to your *.cargo/config.toml* file in your source repository depending on your scenario. See [Permissions table](../feeds/feed-permissions.md#permissions-table) to learn more about the different roles and their permissions:
95+
96+
- **Feed Readers and anonymous users**:
7197
72-
```
73-
[registries]
74-
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
98+
```
99+
[registries]
100+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
101+
102+
[source.crates-io]
103+
replace-with = "<FEED_NAME>"
104+
```
105+
106+
- **Feed and Upstream Readers, Feed Publishers, and Feed Owners**: Be sure to include the additional flag (*~force-auth*) for proper authentication with your feed, as shown below:
75107
76-
[source.crates-io]
77-
replace-with = "<FEED_NAME>"
78-
```
108+
```
109+
[registries]
110+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>~force-auth/Cargo/index/" }
111+
112+
[source.crates-io]
113+
replace-with = "<FEED_NAME>"
114+
```
115+
116+
::: moniker-end
117+
118+
::: moniker range="azure-devops-2022"
119+
120+
1. Sign in to your Azure DevOps collection, and then navigate to your project.
121+
122+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
123+
124+
1. Select **Connect to feed**, and then select **Cargo** from the left navigation pane.
125+
126+
1. If this is the first time using Cargo with Azure Artifacts, make sure you have installed [rustup](https://rustup.rs/).
127+
128+
1. Add the provided snippet from the **Project setup** section to your *.cargo/config.toml* file in your source repository:
129+
130+
- **Project-scoped feed**:
131+
132+
```
133+
[registries]
134+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<COLLECTION_NAME>/<PROJECT_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
135+
136+
[source.crates-io]
137+
replace-with = "<FEED_NAME>"
138+
```
139+
140+
- **Collection-scoped feed**:
141+
142+
```
143+
[registries]
144+
<FEED_NAME> = { index = "sparse+https://pkgs.dev.azure.com/<COLLECTION_NAME>/_packaging/<FEED_NAME>/Cargo/index/" }
145+
146+
[source.crates-io]
147+
replace-with = "<FEED_NAME>"
148+
```
149+
150+
::: moniker-end
79151
80152
## Configure a credential provider
81153

docs/artifacts/how-to/public-feeds-upstream-sources.md

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ pip install
115115

116116
#### [Cargo](#tab/cargo)
117117

118+
Feed and Upstream Reader (Collaborator) roles or higher must use an additional flag to authenticate with their public feed in order to install packages. Be sure to follow the instructions in [Cargo - Connect to a feed](../cargo/cargo-upstream-source.md#connect-to-your-feed) to properly authenticate with your feed, and then run the following command in your project directory to restore your packages.
119+
118120
```Command
119121
cargo build
120122
```

0 commit comments

Comments
 (0)