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
Copy file name to clipboardExpand all lines: docs/artifacts/cargo/cargo-upstream-source.md
+87-15
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ Azure Artifacts recommends having a dedicated feed for consuming crates from cra
47
47
48
48
## Connect to your feed
49
49
50
+
::: moniker range="azure-devops"
51
+
52
+
#### [Private feed](#tab/privatefeed/)
53
+
50
54
1. Sign in to your Azure DevOps organization, and then navigate to your project.
51
55
52
56
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
55
59
56
60
1. If this is the first time using Cargo with Azure Artifacts, make sure you have installed [rustup](https://rustup.rs/).
57
61
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:
59
63
60
-
- Project-scoped feed:
64
+
-**Project-scoped feed**:
61
65
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**:
65
75
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
+
```
69
83
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**:
71
97
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:
75
107
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/" }
Copy file name to clipboardExpand all lines: docs/artifacts/how-to/public-feeds-upstream-sources.md
+2
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,8 @@ pip install
115
115
116
116
#### [Cargo](#tab/cargo)
117
117
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.
0 commit comments