Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create AAD B2C Application Registration via .NET/Powershell

We are trying to register applications with AAD B2C in a programmatic fashion (either Powershell or C#/.NET) in order to create and deploy app service web apps from azure automation during automatic tenant creation. Given the context of AAD B2C Graph API seems like the way to go.

Is adding an application to AAD B2C possible?

If yes, via what technology (vanilla REST? we could not find documentation specific to AAD B2C applications)?

So far we tried using the Graph API from the Azure AD 2.0 preview as well as the Graph Client.

After figuring out that the step of creating an app requires a service principal with global administrator rights (we would love to further restrict the permissions) we face the issue that applications do not show up in B2C but are present in the AAD section of the Azure portal.

One of our attempts to add via powershell (we tried to set all parameters to closely match an application manually created in the portal B2C tenant management blade):

New-AzureADApplication -DisplayName $tenantCname -IdentifierUris "https://$tenantCname.$aadTenant.onmicrosoft.com" -ReplyUrls $tenantUrl -AvailableToOtherTenants $true -Oauth2AllowImplicitFlow $true -PublicClient $false

The command succeeds but the application does not show up in the portal under AZURE AD B2C SETTINGS > Settings > Applications but only in Azure Active Directory/App registrations. Given that both blades relate to the same directory we are not sure what differentiates our app creation from an interactive one.

Are there any additional steps we are missing? Specific properties/extensions?

like image 217
Simon Opelt Avatar asked Nov 09 '22 06:11

Simon Opelt


1 Answers

I also created the application and service principal using PowerShell and then compare them with the B2C application created by manually using Azure AD Graph. However not able to find there is any property would effect the application.

Are there any additional steps we are missing? Specific properties/extensions?

Also there is no such properties/extensions about this feature was public based on the entity reference for the application and service principal here. So I don't think it is possible to create a B2C application programatcially at present.

If you require this feature, you may submit the feedback from here.

like image 180
Fei Xue - MSFT Avatar answered Dec 02 '22 08:12

Fei Xue - MSFT