> 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/kdosukyan/local-code-scanning/azure-devops-server-setup-for-local-code-scanning.md).

# ローカルコードスキャンのためのAzure DevOps Server設定

Aikido Security Local Scanner は、あなたの環境内で Aikido Security のスキャンを実行できるツールであり、コードが決して外部に出ないことを保証します。スキャンはローカルで実行され、その結果は Aikido Security プラットフォームにアップロードされます。この構成により、レポート目的で Local Scanner を Azure DevOps Server プロジェクトへ簡単に統合できます。

## ローカルスキャンの設定方法 <a href="#how-to-set-up-local-scanning" id="how-to-set-up-local-scanning"></a>

**前提条件**: Local Scanning を許可するアカウントを作成済みであることを確認してください。 [Local Scanning アカウントの作成方法の詳細](https://help.aikido.dev/en/articles/9070345-how-to-create-an-account-for-local-scanning-on-aikido).

## 1. Local Scanner のパイプラインを設定する <a href="#id-1-setting-up-a-local-scanner-pipeline" id="id-1-setting-up-a-local-scanner-pipeline"></a>

左側のナビゲーションで Pipelines に移動し、 *パイプライン* を選択します *新しいパイプライン* または *パイプラインを作成*. Configure ステップで、 *スターターパイプライン*。以下のサンプル パイプラインは、main ブランチへの変更時にスキャンをトリガーします。最初のスキャンはデフォルト ブランチで実行することが重要です。これにより、リポジトリが Aikido で正しく設定されます。

```yaml
trigger:
  branches:
    include:
    - main

pool:
  vmImage: 'ubuntu-latest'

container:
  image: aikidosecurity/local-scanner:latest
  options: --entrypoint=""

steps:
- script: aikido-local-scanner scan $BUILD_SOURCESDIRECTORY --apikey $(AIKIDO_API_KEY) --repositoryname $BUILD_REPOSITORY_NAME --branchname main
```

これがこのリポジトリに対する最初のスキャンである場合、Aikido は指定した名前でリポジトリを作成し、すべてのスキャン結果をそこに保存します。その後のスキャン結果は、Aikido 内でこのリポジトリ名の下に集約されます。

既定ではすべてのスキャンタイプが実行されます。スキャンの一部のみ（例: SAST スキャンのみ）を実行したい場合は、次の `--scan-types` オプションを指定して実行できます。CLI オプションの詳細は次で確認できます [こちら](https://help.aikido.dev/en/articles/9027526-local-scanner-cli-options).

release gating mode または PR gating mode で scanner を実行することもできます。release gating mode は、リリース前にリポジトリをスキャンする際に役立ちます。潜在的なリリースの前に未解決の問題がないことを確認できるためです。release gating mode で実行すると、スキャン完了後に選択した重大度以上の未解決の問題がある場合、scanner プロセスは失敗します。PR gating mode は、PR 内で新たに導入された可能性のある問題をスキャンするために使用できます。

release または PR gating mode に関する詳細は、次で確認できます [この記事](/docs/docs-ja/kdosukyan/local-code-scanning/pr-gating-for-code-using-local-scanner.md).

ここで、APIキーをシークレット変数として追加します。右上の variables をクリックして新しい変数を追加してください。名前に AIKIDO\_API\_KEY を入力し、 *Keep this value secret* チェックボックス。秘密の値を見つけるには、ステップ 2 に進んでください。

## 2. 認証トークンを取得する <a href="#id-2-get-your-authentication-token" id="id-2-get-your-authentication-token"></a>

1. 次へ移動します： [Local Scanner の設定ページ](https://app.aikido.dev/settings/integrations/localscan)
2. 認証トークンを生成してコピーします。このトークンを表示できるのは一度だけであることに注意してください。
3. このトークンを、パイプライン設定の AIKIDO\_API\_KEY 変数の値として貼り付けてください。

これで、パイプラインを初めて作成して実行できます。

## 3. スキャン結果を確認する <a href="#id-3-check-your-scanning-results" id="id-3-check-your-scanning-results"></a>

最初のスキャンが完了したら、Aikido Feed に移動して結果を確認できます。スキャンのすべての結果を含むリポジトリが作成されます。


---

# 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/kdosukyan/local-code-scanning/azure-devops-server-setup-for-local-code-scanning.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.
