Azure B2C Active Directory:在所有用户上更新一个属性

问题描述 投票:0回答:1

在当前项目中,我正在使用Microsoft的Azure B2C Actice目录。

我的计划是更新每个用户的特殊属性(testClaim)。>>

我实际上正在做的是在AD中加载所有用户并在foreach循环中更新每个用户。

        var requestBody = new SetTestClaimRequest
        {
            ClaimName = "testClaim",
            Value = "thisIsATestValue"
        };


        var client = new RestClient("myRes");
        var request = new RestRequest(Method.PUT);
        request.AddJsonBody(requestBody);

我面临的问题是,GraphApi在几个请求之后就开始阻止我的请求,并回答以下错误:

Error Calling the Graph API: 
{
  "odata.error": {
    "code": "Request_ThrottledTemporarily",
    "message": {
      "lang": "en",
      "value": "Your request is throttled temporarily. Please try after 150 seconds."
    },
    "requestId": "ccf8a936-490e-4c4a-87aa-125157b2e6dd",
    "date": "2020-04-17T12:37:44"
  }
}

是否有一种方法可以避免这种情况而不会限制我的请求?在我看来,节流不是一种选择,因为要花费数小时才能更新与之打交道的用户数量。

在当前项目中,我正在使用Microsoft的Azure B2C Actice目录。我的计划是更新每个用户的特定属性(testClaim)。我实际上正在做的是加载所有用户...

azure-active-directory azure-ad-b2c azure-ad-graph-api
1个回答
1
投票

不,无法绕过节流限制。以可接受的速率处理可能需要几个小时。每分钟最多尝试1000次操作。如果获得HTTP 429,请确保实施退避逻辑。

© www.soinside.com 2019 - 2024. All rights reserved.