LoginSignup
2
0

More than 1 year has passed since last update.

Azure Pipelines Tips 8 選

Last updated at Posted at 2021-12-03

本記事は Azure DevOps | Advent Calendar 2021 4 日目の記事です。
Pipelines 観点から見て、よくありそうで使えそうなものを集めました。

Microsoft-hosted agents で IP フィルターがかかっているネットワークや、社内ネットワークにアクセスしたい

weekly JSON file を許可する必要があります。
Microsoft-hosted agents for Azure Pipelines - Azure Pipelines | Microsoft Docs

週次チェックの管理コストが嫌な場合は Self-hosted agents または Scale set agents を使ったほうが安心です。

また、厳格なセキュリティが必要なければ一時的に IP フィルタを解除するというタスクを Pipeline に組み込んでもよいです。
管理対象サーバーに SSH の IP フィルタリングがされているとき / Azure Pipelines で Ansible を使う - Qiita

Self-hosted Agents のコストを削減したい

Scale set agents なら保持しておくマシン設定を 0 にすることで休日や夜間など、 VM を起動する必要がない時間帯のコストを削減できます。
Azure Pipelines で VMSS agents も便利だよ、という話 - Qiita

Microsoft-hosted agents の vmImage をバージョンアップするときの注意点

ここに現在使っている vmImage にプリインストールされているソフトウェアが書いてあります。
GitHub - actions/virtual-environments: GitHub Actions virtual environments

vmImage をバージョンアップする場合、使っているソフトウェアがインストールされているか確認しましょう。もしインストールされていない場合かつ、そのソフトウェアを使いたい場合は、 Pipeline のタスクとして手動でソフトウェアをインストール&それを使うような処理を追加する必要があります。

例: ubuntu-18.04 & PHP 7.3 を使っているプロジェクトで ubuntu-20.04 にアップデートする場合

ubuntu-20.04 には PHP 7.3 が含まれていないため、 Pipeline のタスクとして PHP 7.3 をインストールする&後続の処理で 7.3 を使うようにする 2 つのタスクを追加する必要があります。
PHP / virtual-environments/Ubuntu2004-README.md at main · actions/virtual-environments · GitHub

Microsoft-hosted agents にプリインストールするソフトウェアを追加したい

ここの Issue を検索してなければ Tool request の Issue を書きましょう。テンプレートになっているので書きやすいです。
Issues · actions/virtual-environments
New Issue · actions/virtual-environments

Self-hosted agents がキューに残り続ける

該当のエージェントプールを見て、 Agent がオンラインかつ Enabled になっていることを確認しましょう。
Agents pools - Azure Pipelines | Microsoft Docs

Self-hosted agents のディスク容量枯渇問題

メンテナンスジョブを使って古い作業ディレクトリとリポジトリを定期的にクリーンアップしましょう。
What is a maintenance job? / Agents pools - Azure Pipelines | Microsoft Docs

自動作成したサービスプリンシパルの有効期限延長

サービスプリンシパルを開いて Edit して Save するだけ。
Service principal's token expired / Troubleshoot Azure Resource Manager service connections - Azure Pipelines | Microsoft Docs

サービスが止まっているかどうか確認したい

ここから見られます。過去の履歴も見られます。ごく稀に一部の機能のパフォーマンスが悪くなったりしています。
Azure DevOps - Status

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0