Create AAD B2C Application Registration via .NET/Powershell
<p>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.</p>

<p>Is adding an application to AAD B2C possible?</p>

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

<p>So far we tried using the Graph API from the <a href="https://www.powershellgallery.com/packages/AzureADPreview/2.0.0.7" rel="noreferrer">Azure AD 2.0 preview</a> as well as the <a href="https://www.nuget.org/packages/Microsoft.Azure.ActiveDirectory.GraphClient/2.1.1" rel="noreferrer">Graph Client</a>.</p>

<p>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 <a href="https://portal.azure.com" rel="noreferrer">Azure portal</a>.</p>

<p>One of our attempts to add via powershell (we tried to set all parameters to closely match an application manually created in the portal <a href="https://portal.azure.com/#blade/Microsoft_AAD_B2CAdmin/TenantManagementBlade" rel="noreferrer">B2C tenant management blade</a>):</p>

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

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

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