gpt4 book ai didi

azure - 通过脚本创建 b2c-extensions-app

转载 作者:行者123 更新时间:2023-12-03 05:27:31 30 4
gpt4 key购买 nike

当您创建 ADB2C 租户资源时,还会创建一个名为 b2c-extensions-app 的应用程序注册。请勿修改。 AADB2C 用于存储用户数据。这是一个特殊的应用程序,需要进行增删改查操作。

在互联网和文档中,提到它是自动创建的,但事实并非如此。它仅在您登录该租户并转到应用程序注册后创建,它是某种触发器。我怎么知道这个?我联系了 Microsoft 支持。

我的问题:这会干扰我的一些自动化脚本。有谁知道我可以向其发出休息请求以便创建此应用程序的端点。

最佳答案

好吧,经过很多次尝试和错误,我终于找到了导致创建该应用程序的端点。我将在 PowerShell 中显示一个代码片段。

$context = Connect-AzAccount ...

# Aquire an access token from the resource: https://management.core.windows.net/
$tokenItem = [Microsoft.Azure.Commands.Common.Authentication.AzureSession]::Instance.AuthenticationFactory.Authenticate(
$context.Account,
$context.Environment,
$TenantId,
$null,
'Never',
$null,
'https://management.core.windows.net/')

Invoke-WebRequest -Uri "https://main.b2cadmin.ext.azure.com/api/tenants/GetAndInitializeTenantPolicy?tenantId=<your_tenant_name>&skipInitialization=false" `
-Method "GET" `
-Headers @{
"Authorization" = "Bearer $($tokenItem.AccessToken)";
"x-ms-client-request-id" = ([guid]::NewGuid().Guid)
}

关于azure - 通过脚本创建 b2c-extensions-app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67706798/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com