首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自动创建Azure AD B2C租户

自动创建Azure AD B2C租户
EN

Stack Overflow用户
提问于 2015-10-27 17:42:08
回答 2查看 1.7K关注 0票数 8

是否可以通过编程方式创建Azure AD B2C租户(例如,使用Powershell、REST API)?

我们正在开发一个多租户Azure解决方案,我们希望在新租户注册时自动创建一个SaaS B2C租户。

EN

回答 2

Stack Overflow用户

发布于 2016-03-24 22:33:40

我担心目前您不能使用API或PowerShell创建Azure AD。虽然您可以在订阅中创建其他目录,但不能使用任何自动化创建一个目录。

票数 2
EN

Stack Overflow用户

发布于 2020-04-18 15:31:39

您可以使用PowerShell AzureADPreview 2.0模块来管理自定义策略、应用程序等。虽然不像ARM模板那样完整,但您现在可以自动化许多事情。

完整的文档在这里:AzureADPreview 2 docs

我没有成功地将这个模块安装到“旧的” PowerShell (5.x)上,所以我尝试了一下“新的”PowerShell 7(核心)。PowerShell 7和AzureAD模块的唯一问题是Connect-AzureAD使用的加密函数不在.NET核心中,因此您必须使用-UseWindowsPowerShell选项导入AzureADPreview模块。

下面是一个适用于PowerShell 7的示例:

代码语言:javascript
复制
Install-Module AzureADPreview
Import-Module AzureADPreview -UseWindowsPowerShell
$tenantId = "yourb2ctenant.onmicrosoft.com"

# Note: this will interactively ask your credentials. 
#       If you want to run this unattended, use the -Credential parameter with a PSCredential object with a SecureString
Connect-AzureAD -TenantId $tenantId

# ready to go 

#list your all custom policies:
Get-AzureADMSTrustFrameworkPolicy

# upload a policy:
$policyId = "B2C_1A_TrustFrameworkBase"
$policyFileName "YourTrustFrameworkBase.xml"
Set-AzureADMSTrustFrameworkPolicy -Id $policyId -InputFilePath $policyFileName

#list your all apps    
Get-AzureADApplication 

# examine one of you app and get ideas 
$application = Get-AzureADApplication -ObjectId af46a788-8e55-4301-b2df-xxxxxxxxx 

# create an application
$applicationName = "yourappname"
$application = New-AzureADApplication -DisplayName $applicationName -PublicClient $true etc
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33364439

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档