Skip to content

Commit 2d9a984

Browse files
authored
Merge pull request #644 from telerik/dess-nuget-keys
added Telerik NuGet Source article
2 parents 214c419 + a1c34d2 commit 2d9a984

File tree

7 files changed

+213
-6
lines changed

7 files changed

+213
-6
lines changed
126 KB
Loading
153 KB
Loading
152 KB
Loading
62.1 KB
Loading

getting-started/Installation/install-nuget-packages.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ This article describes how you can install the Document Processing Libraries usi
1818

1919
## Manually Download NuGet Packages
2020

21-
1\. First you need to log in using your Telerik licensed account. Telerik Document Processing is a part of several Telerik bundles and is available in the Downloads section of the suite with which you've obtained the product, e.g. UI for Blazor. This way you will be able to download the packages:
21+
This approach allows you to setup a local NuGet package source, so you can install the Telerik products without an active Internet connection and without setting up our private feed.
22+
23+
1\. Copy all the .nupkg files we provide to your preferred local feed location. First you need to log in using your Telerik licensed account. Telerik Document Processing is a part of several Telerik bundles and is available in the Downloads section of the suite with which you've obtained the product, e.g. UI for Blazor. This way you will be able to download the packages:
2224

2325
![install-using-nuget001](images/install-using-nuget001.png)
26+
27+
28+
**Telerik Document Processing** is also available as a separate distibution in your account: [Download Product Files]({%slug installation-nuget-packages%})
2429

2530
2\. Then, you need to add packages to Visual Studio. Open the NuGet manager and then click the Options button:
2631

getting-started/Installation/nuget-keys.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Restoring NuGet Packages in CI
33
page_title: Restoring NuGet Packages in CI
4-
description: "Learn how to use NuGet Keys to authenticate with the Telerik NuGet server and restore Telerik Document Processing packages in your CI or desktop environment."
4+
description: Learn how to use NuGet Keys to authenticate with the Telerik NuGet server and restore Telerik Document Processing packages in your CI or desktop environment.
55
slug: using-nuget-keys
66
tags: telerik, document, processing, restore, nuget, packages, ci, continuous, integration, installation
77
published: True
@@ -25,14 +25,21 @@ Unlike your Telerik credentials, a NuGet Key has a limited scope and can be used
2525

2626
1. Go to the [**Manage NuGet Keys**](https://www.telerik.com/account/downloads/nuget-keys) page in your Telerik account.
2727

28-
1. Select the **DOWNLOADS** tab and then **Manage NuGet Keys**.
28+
1. Alternatively, select the **Downloads** tab from your Telerik account and then **NuGet Keys**.
2929

3030
![Manage NuGet Keys](images/manage-nuget-keys.png)
3131

32+
The **NuGet Keys** can be accessed from the **License Keys** section as well:
33+
34+
![NuGet Keys from License Keys](images/access-nuget-keys-from-license-keys.png)
35+
36+
3237
1. To create a new key, select the **Generate New Key** button.
3338

3439
1. Enter a name for the NuGet Key, and then select **Generate Key**.
3540

41+
![Generate NuGet Key](images/generate-nuget-key.png)
42+
3643
1. To copy the key, select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **NuGet Keys** page displays only a portion of the key.
3744

3845
![Copy Generated NuGet Key](images/copy-nuget-key.png)
@@ -63,6 +70,8 @@ There are two popular ways to use the Telerik NuGet server in a build:
6370

6471
For more information on how to use NuGet keys in a build, check the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
6572

73+
The examples below assume that the secret environment variable name is `TELERIK_NUGET_KEY`.
74+
6675
### Using a nuget.config File with Your Projects
6776

6877
1. In your `nuget.config` file, set the `Username` value to `api-key` and the `ClearTextPassword` value to an environment variable name:
@@ -77,16 +86,16 @@ For more information on how to use NuGet keys in a build, check the [Announcing
7786
<packageSourceCredentials>
7887
<MyTelerikFeed>
7988
<add key="Username" value="api-key" />
80-
<add key="ClearTextPassword" value="%MY_API_KEY%" />
89+
<add key="ClearTextPassword" value="%TELERIK_NUGET_KEY%" />
8190
</MyTelerikFeed>
8291
</packageSourceCredentials>
8392
...
8493
</configuration>
8594
```
8695

87-
1. Set the `MY_API_KEY` environment variable by using the value of your pipeline/workflow secret.
96+
1. Set the `TELERIK_NUGET_KEY` environment variable by using the value of your pipeline/workflow secret.
8897

89-
The exact steps to set the `MY_API_KEY` environment variable depend on your workflow. For more details, refer to the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
98+
The exact steps to set the `TELERIK_NUGET_KEY` environment variable depend on your workflow. For more details, refer to the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
9099

91100
### Using Only CLI Commands
92101

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
title: Telerik NuGet Source
3+
page_title: Telerik NuGet Feed
4+
description: Explore the different ways to add the Telerik NuGet feed to your system, and start using NuGet packages to install the Telerik Document Processing libraries.
5+
slug: telerik-nuget-source
6+
tags: get, started, installation, nuget, feed
7+
published: True
8+
position: 8
9+
---
10+
11+
# Telerik NuGet Source
12+
13+
This article explains how to add the Telerik NuGet package feed to your environment. You can use it to obtain the Telerik Document Processing libraries instead of [setting up a local NuGet feed]({%slug installation-nuget-packages%}#manually-download-nuget-packages).
14+
15+
The benefit of using an online NuGet source is that you will receive notifications for newer component versions.
16+
17+
You can set up the remote Telerik NuGet feed in the following ways:
18+
19+
* [Use Visual Studio](#use-visual-studio)
20+
* [Use the .NET CLI](#use-the-net-cli)
21+
* [Edit the Nuget.Config file](#edit-the-nuget-config-file)
22+
23+
>tip When working with the .NET CLI or editing the `NuGet.Config` manually, you can use your Telerik account credentials or a [NuGet API Key](#use-nuget-api-key). If you are logging in to telerik.com through single sign-on (SSO), use a [NuGet API Key](#use-nuget-api-key).
24+
25+
>warning Never hard-code Telerik account credentials or NuGet API keys in a `NuGet.Config` file in a GitHub repository, Docker image, or any location that may be accessed by unauthorized parties. A NuGet key is valuable, and bad actors can use it to access the NuGet packages that are licensed under your account. A credentials abuse can lead to a review of the affected Telerik account.
26+
27+
For NuGet-related issues, see [Troubleshooting Telerik NuGet]({%slug troubleshooting-telerik-nuget%}).
28+
29+
For information on automated builds, CI, and CD, see [Restoring NuGet Packages in Your CI Workflow]({%slug using-nuget-keys%}).
30+
31+
32+
## Use Visual Studio
33+
34+
When adding NuGet sources in Visual Studio, the credentials are encrypted and stored outside the `NuGet.Config` file.
35+
36+
Refer to the [Microsoft documentation about using packages in Visual Studio](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio), or follow the steps below for Visual Studio on Windows.
37+
38+
1. Open Visual Studio and go to Tools > NuGet Package Manager > Package Manager Settings > Package Sources.
39+
40+
1. Click the **+** button at the top right-hand side.
41+
42+
1. Add the Telerik Feed URL `https://nuget.telerik.com/v3/index.json` and choose a Name for that package source (for example, "TelerikOnlineFeed").
43+
44+
1. Click OK.
45+
46+
1. Open a project that references a Telerik NuGet package.
47+
* Make sure to remove local `NuGet.Config` files from the solution that contain information about Telerik packages.
48+
49+
1. Rebuild the solution.
50+
51+
1. A Windows prompt will ask for the Telerik feed credentials. Enter your Telerik email and password.
52+
* Check the Remember My Password checkbox.
53+
54+
1. Your project should now build and restore all packages - including those from nuget.org and from Telerik.
55+
* If you experience issues, see the [Troubleshooting Telerik NuGet]({%slug troubleshooting-telerik-nuget%}).
56+
57+
58+
## Use the .NET CLI
59+
60+
When adding NuGet sources from the .NET CLI, the credentials are stored in the `NuGet.Config` file. The [password can be encrypted on Windows, but with limitations](#store-encrypted-credentials). You can use a plain text password, but for better security, [generate a NuGet API Key](#use-nuget-api-key), and use it with the .NET CLI instead of a password.
61+
62+
To add the Telerik NuGet package source with the .NET CLI, use the [`dotnet nuget add source`](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source) command. This command creates or updates a `NuGet.Config` file for you, so you don't have to [edit it manually](#edit-the-nuget-config-file).
63+
64+
The command below stores the password or NuGet API Key in plain text in the [global config file](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses).
65+
66+
The backslashes `\` below enable multi-line commands for better readability in terminals that support them.
67+
68+
>caption Use the .NET CLI to add the Telerik NuGet source
69+
70+
````SH.skip-repl
71+
dotnet nuget add source https://nuget.telerik.com/v3/index.json \
72+
--name TelerikOnlineFeed \
73+
--username <TELERIK EMAIL or api-key> \
74+
--password <TELERIK PASSWORD or NUGET API KEY> \
75+
--store-password-in-clear-text
76+
````
77+
78+
If you have already stored the Telerik package source, you can update the configuration with the command below.
79+
80+
>caption Use the .NET CLI to update the Telerik NuGet source
81+
82+
````SH.skip-repl
83+
dotnet nuget update source "TelerikOnlineFeed" \
84+
--source "https://nuget.telerik.com/v3/index.json" \
85+
--username <TELERIK EMAIL or api-key> \
86+
--password <TELERIK PASSWORD or NUGET API KEY> \
87+
--store-password-in-clear-text
88+
````
89+
90+
### Store Encrypted Credentials
91+
92+
The .NET CLI supports NuGet password encryption only on the Windows platform. Note that [the encrypted password in the `NuGet.Config` file will work only for one user and one machine](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials).
93+
94+
If you [add the Telerik package source in Visual Studio](#use-visual-studio), the credentials will be encrypted and stored in the Windows Credential Manager on Windows and in the Keychain on macOS.
95+
96+
You can read more about the options provided by the NuGet tooling in the <a href="https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials" target="_blank">packageSourceCredentials section of the NuGet.Config reference</a> article by Microsoft. Note the difference between the `password` and `cleartextpassword` options.
97+
98+
99+
## Edit the NuGet.Config File
100+
101+
NuGet package sources and other settings are stored in a `NuGet.Config` file. You can read more about the file structure in the Microsoft article [NuGet.Config Reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file).
102+
103+
Make sure you are familiar with how such configurations work. Refer to [Common NuGet Configurations](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior) for details about the possible file locations and how multiple `NuGet.Config` files work.
104+
105+
To edit a `NuGet.Config` file and add the Telerik feed, you need to:
106+
107+
1. Ensure you are editing the [correct and desired config file](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses). You can also create a new one with the [`dotnet new nugetconfig` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new).
108+
109+
2. Add the Telerik package source to the config file. Use plain text credentials because the .NET Core NuGet tooling does not fully support encrypted credentials. Here is an example of how your `NuGet.Config` file can look like:
110+
111+
````XML.skip-repl
112+
<?xml version="1.0" encoding="utf-8"?>
113+
<configuration>
114+
<packageSources>
115+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
116+
<clear />
117+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
118+
<add key="TelerikOnlineFeed" value="https://nuget.telerik.com/v3/index.json" />
119+
</packageSources>
120+
<packageSourceCredentials>
121+
<TelerikOnlineFeed>
122+
<add key="Username" value="<TELERIK EMAIL or api-key>" />
123+
<add key="ClearTextPassword" value="<TELERIK PASSWORD or NUGET API KEY>" />
124+
</TelerikOnlineFeed>
125+
</packageSourceCredentials>
126+
</configuration>
127+
````
128+
129+
### Use NuGet API Key
130+
131+
There are two ways to authenticate with the Telerik NuGet server when you add the Telerik NuGet source [with the .NET CLI](#use-the-net-cli) or [edit the `NuGet.Config` file manually](#edit-the-nuget-config-file):
132+
133+
* Use your Telerik account email as the username, and your Telerik password.
134+
* Use `api-key` as the username and your personal [NuGet API Key]({%slug using-nuget-keys%}) as the password.
135+
136+
You can [generate your Telerik NuGet API Key on telerik.com](https://www.telerik.com/account/downloads/nuget-keys). Read more about [Restoring NuGet Packages in Your CI Workflow]({%slug using-nuget-keys%}).
137+
138+
> Always use the NuGet API Key in plain text.
139+
140+
141+
### Package Source Mapping
142+
143+
The Document Processing Libraries' NuGet packages and most of its dependencies reside on `nuget.telerik.com`. On the other hand, the [`Telerik.Licensing` package]({%slug setting-up-license-key%}) resides on `nuget.org`. The correct [package source mapping](https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping) configuration should be similar to the one below.
144+
145+
> Make sure that the `key` values in the `packageSourceMapping` section match the `key` values in the `packageSources` section, otherwise you will get a "Package not found" error.
146+
147+
>caption packageSourceMapping configuration for Telerik Document Processing and other Telerik Packages
148+
149+
<div class="skip-repl"></div>
150+
151+
````XML
152+
<?xml version="1.0" encoding="utf-8" ?>
153+
<configuration>
154+
<packageSources>
155+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
156+
<add key="TelerikOnlineFeed" value="https://nuget.telerik.com/v3/index.json" />
157+
</packageSources>
158+
159+
<packageSourceMapping>
160+
<packageSource key="nuget.org">
161+
<package pattern="*" />
162+
<package pattern="Telerik.Licensing" />
163+
</packageSource>
164+
<packageSource key="TelerikOnlineFeed">
165+
<package pattern="Telerik*" />
166+
</packageSource>
167+
</packageSourceMapping>
168+
</configuration>
169+
````
170+
171+
172+
### Access NuGet Packages behind Firewall
173+
174+
To access the Telerik NuGet feed behind a firewall that restricts outgoing requests, you may need to allow the following domains:
175+
176+
* `nuget.telerik.com`, which provides authentication and license verification
177+
* `downloads.cdn.telerik.com`, which hosts the NuGet packages
178+
179+
The firewall must allow some of the requests to be redirected from `nuget.telerik.com` to `downloads.cdn.telerik.com`.
180+
181+
### Obsolete Telerik NuGet URL
182+
183+
The NuGet v2 server at `https://nuget.telerik.com/nuget` was sunset in November 2024 and is no longer available. The v3 protocol offers faster package searches and restores, improved security, and more reliable infrastructure. To redirect your feed to the NuGet v3 protocol, all you have to do is change your NuGet package source URL to `https://nuget.telerik.com/v3/index.json`.
184+
185+
186+
### Troubleshooting
187+
188+
See the [NuGet Troubleshooting](slug:troubleshooting-nuget) article for tips about common pitfalls when working with the Telerik NuGet feed.
189+
190+
## See Also
191+
192+
* [Restoring NuGet Packages in Your CI Workflow]({%slug using-nuget-keys%})
193+
* [Install using NuGet Packages]({%slug installation-nuget-packages%})

0 commit comments

Comments
 (0)