Hi @Matthias Neugebauer , I think your problem is detailed here.
"It is not possible to create from any IAC tools . As Microsoft.AzureActiveDirectory/b2cDirectories@2019-01-01-preview Rest API hasn't been added to the IAC modules.
As an alternative you can use Az CLI along with Rest API's with the below script :
az login
SUBS=`az account show --query "id" -o tsv` \
RG=b2cdemotest \
DOMAIN=b2cdemo1ansuman \
LOCATION=westeurope
az group create --name $RG --location $LOCATION
# deploy
az rest --method put --url https://management.azure.com/subscriptions/$SUBS/resourceGroups/$RG/providers/Microsoft.AzureActiveDirectory/b2cDirectories/$DOMAIN.onmicrosoft.com?api-version=2019-01-01-preview --body @b2c.json --verbose
# get
az account tenant list
az rest --method get --url https://management.azure.com/subscriptions/$SUBS/resourceGroups/$RG/providers/Microsoft.AzureActiveDirectory/b2cDirectories/$DOMAIN.onmicrosoft.com?api-version=2019-01-01-preview | jq
# delete
az rest --method delete --url https://management.azure.com/subscriptions/$SUBS/resourceGroups/$RG/providers/Microsoft.AzureActiveDirectory/b2cDirectories/$DOMAIN.onmicrosoft.com?api-version=2019-01-01-preview --verbose
> verify if B2C tenant was removed then remove the Resource Group
az group delete --name $RG
Please let me know if you're still having trouble or if you have any questions.
If this answer helped you please mark it as "Verified" so other users can reference it.
Thank you,
James