Showing results for 
Search instead for 
Did you mean: 
New Member

Need help with making a copy of B2C Azure Directory and have it used by new Dynamics CRM instance

I wonder whether you have an answer to my question below.

Currently my organization is sharing a dynamics CRM 365 instance (cloud) with another org, each org has its own dynamics portal,  but both portals use one b2c azure active directory for portal user authentication, this has caused issue for both orgs, as the user from one portal can login to another portal without authentication.

Now we want a separate instance for each org. We have copied the current CRM instance (UAT) to a new sandbox instance for test.


My question is that: Can we make a copy of  the current B2C azure directory and have it used by the new instance so a portal user can use his existing credential to login to the new portal? Any help is much appreciated!  

Community Support
Community Support

Hi @DanieleW ,

Do you want to copy data in B2C azure directory to an entity in dynamics?

I'm afraid it's not supported yet.

You could check this doc to see the supported connectors for data integration into CDS:

You could also find all the supported connectors by clicking "get data" in CDS.

If you search for "azure",  B2C azure directory is not listed below.


 You could post your idea about adding this connector for data integration into CDS here:




Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Phoebe,


Thanks a lot for your reply. You mentioned "Do you want to copy data in B2C azure directory to an entity in dynamics?"


No, this is not what I wanted.  I didn't want to copy Azure data to an entity in CRM, instead,  I want  to create another B2C Azure Active Directory (a copy of the current B2C Active directory),  and make it point to the new CRM instance which I copied from the current CRM instance. 


Just like CRM instance is a database instance (at least that's what I think), copy a CRM instance is to create a duplicated database instance at the back-end.  My guess is that Azure directory is another database instance, so it could be copied to a new database instance to become another identical Azure Directory. The new CRM instance can then use this new Azure directory for user authentication. The existing external portal user ( a contact in CRM) can use the same credential to login to the new portal provisioned from the new CRM instance.


Does it make sense to you:)? Thanks. 


- Danielle


Hi @DanieleW ,

So you want to  copy B2C azure directory to another B2C azure directory, copy entity in CRM to another entity in CRM and then relate the new B2C azure directory with new entity  in CRM?

1)B2C azure directory part:

I don't think this is possible.

Since I'm not so familiar with B2C azure directory, I suggest you post your issue here:

2)CRM part:

Yes, this is possible. Refer this doc :



Best regards,


Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @DanieleW ,

may be i got it wrong, but the login without credentials is not a problem in my eyes. 

If you have two portals running on one dynamics cds instance, you could have two websites. And the users must not have rights on both sites. Yes, they could log in as they are users (contacts), but may be in that specific site they have no permissions at all.

We have many portal installations serving diffrent sites from one crm instance with totally diffrent rigths/roles for the same users. Only some users are admins in both systems.


If this was junk or a comment to a misunderstood question, please ignore me 🙂


Have fun,


Hi Christian,

Thanks you so much for your response to my question.  I would like to give you a bit background of the challenge we are facing. 

Currently we have two organizations sharing one CRM instance with one Azure directory for external user authentication for each other's own public portal. It was originally developed this way for cost saving, but the two orgs has no collaboration inside CRM and organizational data are supposed to be totally hidden from each other.  But with shared instance such data separation is very challenging, even with the high customization, we still encounter lot of issues, especially for the shared contacts. 


Now it comes to the point that we want a total instance separation. We also do not want to share the Azure directory as it will create issue if user requests email change from one side.   We can copy the current CRM to a new CRM instance, but  is it possible to coy the current Azure directory as well for the new CRM instance to use.


Hope it makes sense for you. Thanks!


Hi @DanieleW ,

I understand what you want.

You want to copy CRM  instance  and copy Azure directory.

And then make new CRM  instance connected with new Azure directory.

Am I right?

Copying CRM  instance is simple. The key point is about copying Azure directory.

Actually, I do not think it's supported to copy the whole  Azure directory directly.

But since I am not so familiar with Azure directory, I suggest you ask question about how to cloning  Azure directory in this forum:




Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


well, in my opinion (not an expert on that) the entries in the b2c directory have an identifier which will (should/have to?) be unique overall. 

But this will not stop you from creating a new directory from an old one i think (may be not standrd, but powershell commandlets are surely available). 

In order to get things working again in the new crm, you could create the external identities from the new directory in the new crm system. The external identities is just the objectid of the user linked to the contact (of course you have to do the neccessary setup for the new directory as well).

The keyproblem will be how to match the users. May be, the email of the user is enough. If not, you could may be write a powershellscript which creates users in the new directory and writes a sort of translation existing objectid to new objectid. This could then be used to create the external identities entries.

Just have a look in the external identities entities and you will immediately get the relationship.

Hope this helps searching for a solution,


Hi Christian,


Thank you so much for your help on this. Your suggestion does sound a possible solution! 


Ideally I would like to make a copy of the existing B2C directory, so the B2C object ID and user's password can be kept the same. 


But if not, just like what you mentioned, I could create the users in the new B2C directory based on CRM contacts' email addresses, then update the contacts in CRM with the new object IDs.  


Thanks again for your help.



Thanks Phoebe.

I will post my question  "how to clone Azure directory" in the forum you suggested.

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Are Your Ready?

Test your skills now with the Cloud Skill Challenge.


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (46,274)