I want to create an Azure AD B2C tenant via the AzureDevops pipeline using an ARM template.
This question has been answered as it is not possible on below questions :
However, Microsoft documentation says it is possible :
Microsoft.AzureActiveDirectory b2cDirectories
Remarks
You can create a B2C tenant with an ARM template or Bicep file, but you can't update an existing B2C tenant.
I am really confused, Microsoft is saying it can be created, but nowhere I could find a sample ARM template json file or an information about how to do it.
As with Microsoft, some resources also mention that this can be done using Biceps, can anyone confirm if Microsoft's statementt : "You can create a B2C tenant with an ARM template" is correct and direct me how to do it ?
Creating an Azure AD B2C tenant must be done in the context of a signed-in user. This is required so that the latter can be added to the new tenant as the first global admin. You might try automating the process authenticating as a user using the ROPC flow. Special considerations must be taken into account such as creating a user account and password on the fly (to be disposed once the creation/post steps have been fulfilled) using a service principal or managed identity and/or storing its password using a secure solution such as KeyVault.