> 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 がプライベートパッケージを含む依存関係を更新するには、正確なロックファイル更新を生成できるように、プライベート 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.
