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

Azure Cosmos DBにAzure App Serviceから読み書きするための設定

Last updated at Posted at 2023-04-23

本記事では、Azure Cosmos DBにAzure App Serviceから読み書きする際のロール付与方法を記載します。

前提

  • Azureアカウントを持っていること
  • Azure App ServiceとAzure Cosmos DBがすでに構築されていること
  • Azure CLIがインストールされており、Azureにログインしていること

手順

  1. Azure App Serviceの設定->IDから、システム割り当てマネージドIDを有効にし、プリンシパルIDをメモする。
    image.png
  2. Azure CLIから、以下のコマンドを実行し、Cosmos DB組み込みデータ共同作成者ロールを割り当てる。
az cosmosdb sql role assignment create --account-name <Cosmos DB アカウント名> --resource-group <Cosmos DB アカウントが属するリソースグループ名> --scope "/" --principal-id <マネージド ID のプリンシパル ID> --role-definition-id "00000000-0000-0000-0000-000000000002"

以上です。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?