> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/autify-university/integrations/azure-pipelines-integration.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Azure Pipelines 連携

Autify ではお手持ちのAzure Pipelines workflow から簡単にテストプランやシナリオを実行できる公式の手法を提供しています。

## はじめてみよう

このドキュメントでは、皆さんのGit リポジトリでどのようにAzure Pipelines 連携を利用するかを順に説明していきます。

### 前提条件

まず、すでにAzure Pipelines workflow を使ってステージングやプロダクション等へのソフトウェアのデプロイを行なっているものとします。そのデプロイstep のすぐ後にAutify のテストを実行するstep を追加することで、新しくデプロイされたソフトウェアがエンドツーエンドのユーザ体験を損ねていないことを確認できるようにします。

次に、[Autify NoCode Web](https://app.autify.com) でテストプランかテストシナリオを作成する必要があります。テストシナリオは、そのAzure Pipelines workflow でソフトウェアがデプロイされるウェブサイトに対してレコーディングすることになります。テストプランまたはシナリオのURL (例: `https://app.autify.com/projects/00/scenarios/000`) をメモしておいてください、後ほど利用します。

さらに、[パーソナルアクセストークンを生成する](https://help.autify.com/nocode-web/autify-university/integrations/integrate-with-api.md#issue-a-personal-access-token)必要があります。後ほどGitLab CI/CD variables に保存するために、生成されたトークンはどこかにメモしておいて下さい。

*注: パーソナルアクセストークンは1人のユーザに紐づいてしまうので、CI/CD 連携のために組織にマシンユーザを作って、そのパーソナルアクセストークンを使うことをお勧めします。*

### パーソナルアクセストークンをAzure Pipelines variables に保存

上で生成したパーソナルアクセストークンを[Azure のドキュメント](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables?view=azure-devops\&tabs=yaml,bash)に従って、secret variables に保存します。

Secret variable の名前は任意ですが、その名前はAzure Pipelines を定義するときに参照します。ここでは`AUTIFY_WEB_ACCESS_TOKEN` と命名したと仮定しておきます。

### Autify NoCode Web を実行するAzure Pipelines step を追加

それでは、お手持ちのAzure Pipelines workflow に新しいstep を追加しましょう。お手持ちの`azure-pipelines.yml` を開き、以下の例を参考にしてください。URL の値(`https://app.autify.com/projects/00/scenarios/000`)は上でメモしたURL になります。

{% hint style="warning" %}
**Windows runner はまだサポートしていません。**

もしデプロイjob がWindows runner で実行されている場合は、`ubuntu-latest` か`macOS-latest` で実行される新しいjob をデプロイjob の後に追加して、そこに以下のsteps を追加する必要があります。
{% endhint %}

***

シンプルにテストを開始してstep を終了 (テストの完了は待たない):

```yaml
- script: curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
  displayName: 'Install Autify CLI'

- script: autify web test run https://app.autify.com/projects/00/scenarios/000
  displayName: 'Run test on Autify NoCode Web'
  env:
    AUTIFY_WEB_ACCESS_TOKEN: $(AUTIFY_WEB_ACCESS_TOKEN)
```

テストを開始して、それが完了するかタイムアウトするまで待つ:

```yaml
- script: curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
  displayName: 'Install Autify CLI'

- script: autify web test run https://app.autify.com/projects/00/scenarios/000 --wait
  displayName: 'Run test on Autify NoCode Web'
  env:
    AUTIFY_WEB_ACCESS_TOKEN: $(AUTIFY_WEB_ACCESS_TOKEN)
```

**警告: この設定はテスト完了を待っている間もAzure Pipelines runner minites を消費します。タイムアウトを延長するときは注意してください。**

`--url-replacements` を使ってテストプラン又はシナリオを別のURL に対して開始する:

```yaml
- script: curl https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/stable/install-standalone.sh | sh
  displayName: 'Install Autify CLI'

- script: autify web test run https://app.autify.com/projects/00/scenarios/000 --url-replacements http://example.com=http://example.net
  displayName: 'Run test on Autify NoCode Web'
  env:
    AUTIFY_WEB_ACCESS_TOKEN: $(AUTIFY_WEB_ACCESS_TOKEN)
```

`--url-replacements` はステージングのウェブサイトに対してプロダクションのウェブサイトで記録したテストシナリオを実行したい時などに有効です。

## まとめ

Autify のAzure Pipelines 連携を使うことで、デプロイ後にテストプランやシナリオの実行を自動化できるので、無駄な時間を使うことなくリグレッションをすぐに検知して適切な行動を取ることができるようになります。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/autify-university/integrations/azure-pipelines-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
