0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Power Automate で Azure DevOps 組織のユーザーを追加する

Posted at

まとめ

Power AutomateからAzure DevOpsのユーザー追加を行う場合、APIのエンドポイントは通常とは異なるため、Azure DevOpsコネクタではなくHTTPコネクタを使用することで実施できた。

うまくいかない方法と原因

最初は、Azure DevOpsのコネクタを使えばできるだろうと安易に思っていました。
しかし、Power AutomateのAzure DevOpsコネクタのリファレンスを見たところ、組織へのユーザーの追加アクションは存在しません。
だったらAPIを呼べばと思いAzure DevOpsのAPIリファレンスを調べたところ、User Entitlements - Addでユーザーの追加ができることはわかりました。
しかし、これをAzure DevOpsコネクタのHTTPリクエストから呼び出してもうまく動きません。
よくみたところ、APIのエンドポイントがdev.azure.comではなくvsaex.dev.azure.comになっています。コネクタからはURLの一部しか渡していないため、おそらくこれが原因でしょう。

動いた方法

なので、Azure DevOpsコネクタは諦めて、HTTPコネクタを使用しました。認可はPATを用いることで可能だったのですが、コネクタの制約でユーザー名を省略できなかったため、RAWを指定して自分でヘッダーに与える値を生成しています。

image.png
式の中身

base64(concat(':', variables('PAT')))
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?