Bertverbeek4PS / bc2adls

Exporting data from Dynamics 365 Business Central to Azure data lake storage or MS Fabric lakehouse
MIT License
49 stars 20 forks source link

Adds Environment column to exported data #118

Open y0m0 opened 5 months ago

y0m0 commented 5 months ago

Hi @Bertverbeek4PS, first all of thank you for keeping the project alive and maintaining it!

We are currently using bc2adls for a couple of our customers where we have the requirement to extract data from multiple companies and environments and consolidate it across them all. Therefore we simply added a $Environment column to the exported data. Even if our requirement might not be that common I still consider this a good addition without any drawbacks. I also considered simply editing the CopyBusinessCentral notebook to add the environment name by passing it via a parameter, but I think it's cleaner this way.

A little extra info: I am aware that it is recommended to export data from different environments to different lakes, but we opted to not do it because it will involve creating additional pipelines/notebooks/sjd to handle the consolidation. To solve this instead I modified the CopyBusinessCentral notebook to handle data from multiple environments coming into the same lake. I didn't add it to the PR because it might not be relevant for everyone, but can do so if people might find it useful.

Bertverbeek4PS commented 5 months ago

Thanks @y0m0

I'm wondering why you would have the environment name also in the export. Because every company is unique. So in that way I would say that companyname should be sufficient enought.

y0m0 commented 5 months ago

I see your point. There can't be duplicate companies in a single environment, but as far as I know there is no guarantee that the companies are unique across different environments. I believe nothing is stopping a customer from doing something like this: Environment-A / Company-A Environment-B / Company-A

Bertverbeek4PS commented 5 months ago

I see your point. There can't be duplicate companies in a single environment, but as far as I know there is no guarantee that the companies are unique across different environments. I believe nothing is stopping a customer from doing something like this: Environment-A / Company-A Environment-B / Company-A

@y0m0 indeed you can have the situation accross all environments. But in my eyes that would be very rare. Because it isn't possible to have that also for the taxes etc.

But if that is a use case maybe we can put it on a setting to export also the environment and also in a setting in the notebook. In that case the user can choose what he wants.

I can see that is a point for including the environment fields to it but then for consolidation reason.

y0m0 commented 5 months ago

Sounds like a sensible idea, I can modify my PR accordingly.

martin-baylis commented 2 months ago

Sounds like a sensible idea, I can modify my PR accordingly.

Environment and Company GUID in the export would be extremely useful. These are needed in the situation where you refresh from Prod to Sandbox. When doing this since the extension data for BC2ADLS migrates in an active state, you run the risk of data from the new copy (refresh into Sandbox) pushing data to your configured (Prod) destination (ADLS or OneLake).