> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/nuget-private-packages.md).

# NuGet - プライベートパッケージ

Aikido がプライベート パッケージを含む依存関係を更新するには、正確な lockfile の更新を生成できるよう、プライベート NuGet レジストリへのアクセスが必要です。

Aikido では、プライベート NuGet レジストリへの接続を設定する方法が 2 つあります。

1. 〜を介して `nuget.config` ファイル
2. dotnet CLI の資格情報を使用して

## 1. nuget.config ファイルによる設定 <a href="#id-1-configuration-via-nugetconfig-file" id="id-1-configuration-via-nugetconfig-file"></a>

### 前提条件 <a href="#prerequisites" id="prerequisites"></a>

プライベート NuGet パッケージの場合、Aikido は `nuget.config` 認証に使用するファイルです。このファイルは、 `nuget.config` リポジトリのルートにあるものを上書きします。このファイルでは複数のプライベート レジストリを設定できます。

例 `nuget.config` GitHub の NuGet レジストリ上のプライベート パッケージにアクセスするための:

```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="github" value="https://nuget.pkg.github.com/AikidoSec/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <github>
      <add key="Username" value="AikidoSec" />
      <add key="ClearTextPassword" value="ghp_ABC123...XYZ" />
    </github>
  </packageSourceCredentials>
</configuration>
```

プライベート NuGet レジストリでの認証について詳しくは、次のドキュメントをご覧ください。

* [Microsoft - 認証済みフィードからパッケージを取得する](https://learn.microsoft.com/en-us/nuget/consume-packages/consuming-packages-authenticated-feeds)
* [GitHub - NuGet レジストリの操作](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry)

## Aikido での設定 <a href="#configuration-in-aikido" id="configuration-in-aikido"></a>

前提条件を満たしたら、以下の手順に従って、依存関係の更新時に Aikido がプライベート NuGet レジストリで認証できるよう設定できます。

1. Aikido の Autofix にあるアカウントの設定ページに移動し、 [こちら](https://app.aikido.dev/issues/fix/settings).
2. 「Connect Registry」をクリックすると、プライベート レジストリのモーダルが表示されます

<div data-with-frame="true"><figure><img src="/files/93d539d9c2979772d40a2c418b778a2cd588532f" alt=""><figcaption></figcaption></figure></div>

3. パッケージマネージャーとして「Nuget」を選択し、 `nuget.config` オプションを選択します

<div data-with-frame="true"><figure><img src="/files/cc501ea508cf23b96cb5bb132dfbe4b1597cc1dc" alt=""><figcaption></figcaption></figure></div>

4. 設定ファイルを `nuget.config` 認証情報で入力します。Aikido は、設定ファイルを使用される直前まで安全に暗号化します。
5. 「Connect Registry」をクリックして設定を保存します

## 2. .NET の nuget CLI による設定 <a href="#id-2-configuration-via-nets-nuget-cli" id="id-2-configuration-via-nets-nuget-cli"></a>

CLI の設定では、Aikido がプライベート レジストリで認証するために使用できるレジストリの URL、ユーザー名、パスワードが必要です。この情報があれば、以下の手順で設定できます。

1. Aikido の Autofix にあるアカウントの設定ページに移動し、 [こちら](https://app.aikido.dev/issues/fix/settings).
2. 「Connect Registry」をクリックすると、設定モーダルが表示されます
3. パッケージマネージャーとして「Nuget」を選択し、次に「NuGet CLI Registry」オプションを選択します

<div data-with-frame="true"><figure><img src="/files/23a53a586d56fc91b1fc599587517b6ebcb331cc" alt=""><figcaption></figcaption></figure></div>

4. 入力欄に詳細を入力し、「Connect Registry」をクリックして設定を保存します

## 3. 環境変数による設定

NuGet では、Autofix の環境変数を通じて資格情報を提供することもできます。

ファイル `nuget.config` リポジトリ内でプライベート フィードを定義するファイルが必要です。環境変数内のフィード名は `nuget.config`.

1. Aikido の Autofix にあるアカウントの設定ページに移動し、 [こちら](https://app.aikido.dev/issues/fix/settings).
2. 次の環境変数を追加します:
   1. キー: `NuGetPackageSourceCredentials_my-private-feed`
   2. 値: `Username=user;Password=secret-pat`

PAT にはパッケージの読み取りアクセス権が必要です。

<div data-with-frame="true"><figure><img src="/files/ba1d02b0d8e5223684d66c4009bd4bd12f68e2df" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/connect-private-packages/nuget-private-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
