LoginSignup
1
0

Azure VMSS Scale Set Agentのリソースグループを変更する方法

Posted at

Azure Pipelinesの実行環境として、VMSS Scale Set Agentを選択することができます。
VMSSを使ったPipelinesの構築手順は以前公開しています。
Azure DevOps Pipelinesを使ってAzure Container Registryにイメージをpushする(Linux VMSS編)

既にPipelinesを動かした状態で、VMSSの配置先リソースグループを変更する手順を残します。

VMSSリソースグループ移動

  • 稼働しているインスタンスがあると移動できないため削除します。
    image.png

  • 概要から[移動]→[別のリソースグループに移動する]の順に選択し、リソースグループを移動します。
    image.png

Agent pools削除

  • Azure DevOpsにアクセスし、[Project Settings]→[Agent pools]の順に選択します。
    image.png

  • 削除する前にAgent Poolsの設定はメモしておきます。

  • 対象VMSS Scale Set Agentを使っているAgent Poolsを削除します。
    image.png

VMSSからタグ削除

  • Azure Portalから対象VMSSを選択し、[__AzureDevOpsElasticPool]タグを削除します。削除しないとAgent Pools再作成時に「this virtual machine scale set is already in use by pool xxxx」のエラーメッセージが出て再作成することができません(既に使われているVMSS判定にこのタグを使っている模様)
    image.png

Agent Pools再作成

  • まずは実行中のパイプラインがないことを確認します。あればキャンセルしてください。そうしないとAgent Pool再作成時にTF400898エラーが出ます。

  • Agent Poolsを新たに作成します。
    image.png

Releasesジョブ修正

  • Releasesジョブを使っている場合は、Run agent jobのAgent Pool値がNullになっているため再設定します。
    image.png

パイプライン実行

  • ここまで設定したらパイプラインを実行して動作確認をします。
    image.png

  • 実行時に上記のようなパイプライン実行権限付与が必要なメッセージが出た場合は設定します。
    image.png

以上です。

1
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
1
0