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?

Microsoft Fabric の Warehouse の所有権の引き継ぎをノートブックで実行する

Last updated at Posted at 2024-07-08

はじめに

により所有権を変更したいが、power shell は面倒なのでFabric ノートブック

所有権の概念はメリットがよくわからないんで本当になんとかしてほしい・・・

なお、現在このAPIで変更できるのはwarehouse のみ

2024/07/08時点の情報です。

コード

python

import requests  

def fabric_item_take_over(workspace_id,item_type,item_id):

    pbi_token = notebookutils.credentials.getToken("pbi")
    base_path = "https://api.powerbi.com/v1.0/myorg"

    url = f"{base_path}/groups/{workspace_id}/{item_type}/{item_id}/takeover"

    result = requests.post(url,headers = {"authorization": "Bearer " + pbi_token}, data={})
    return result
   
items = [  
    {  
        "workspace_id": "URLから確認",  
        "item_id": "URLから確認",  
        "item_type": "datawarehouses"  
    }
]  
  

result = []  
  
for item in items:  
    response = fabric_item_take_over(item["workspace_id"], item["item_type"], item["item_id"])  
    result.append(response.json())  
  
print(result)  


workspace_id,item_idはURLから確認
image.png

実行確認

このウェアハウスの所有者を変えたい。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?