Skip to content

Commit

Permalink
Update manual + starting job queue automatically (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS authored Jan 9, 2025
2 parents 0e99385 + 39bf983 commit 75ccf97
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
10 changes: 8 additions & 2 deletions .assets/FAQs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Here you will find answers to the most frequently asked questions. Please also refer to the [issues](/issues) site to know more or to ask your own questions in the community.

### How do I run the export to the lake in a recurring schedule?
The [Job Queue](https://learn.microsoft.com/en-us/dynamics365/business-central/admin-job-queues-schedule-tasks) feature in Business Central is used to schedule background tasks in a periodic way. You may invoke the [Codeunit `ADLSE Execution`](https://github.com/microsoft/bc2adls/blob/main/businessCentral/src/ADLSEExecution.Codeunit.al) through the feature to export the data increments to the lake as a scheduled job. You may click `Schedule export` on the main setup page to create this job queue.
The [Job Queue](https://learn.microsoft.com/en-us/dynamics365/business-central/admin-job-queues-schedule-tasks) feature in Business Central is used to schedule background tasks in a periodic way. You may invoke the [Codeunit `ADLSE Execution`](https://github.com/Bertverbeek4PS/bc2adls/blob/main/businessCentral/app/src/Execution.Codeunit.al) through the feature to export the data increments to the lake as a scheduled job. You may click `Schedule export` on the main setup page to create this job queue.

If you want to export multiple tables at different frequencies, you can use report [Report `ADLSE Schedule Task Assignment`](https://github.com/Bertverbeek4PS/bc2adls/blob/main/businessCentral/app/src/ScheduleTaskAssignment.Report.al).
In the Job Queue you can set the option "Report Request Page Options"
![Report Request page options](/.assets/JQ_ReportRequestPageOptions.png)
If you go to "Job Queue" -> "Report Request Page" option in the ribbon you can select the category or the table id's you want to export on that specific Job Queue.
![Report Options](/.assets/JQ_ReportOptions.png)

### I have many BC environments in the same tenant. How should I distribute the BC data to my lake?
We recommend that a data lake container holds data only for **only one** Business Central environment. After copying environments, ensure that the export destination on the setup page on the new environment points to a new data lake container.
Expand All @@ -16,7 +22,7 @@ No, only persistent fields on the BC tables can be exported. But, the [issue #88
Data from blob fields in tables are not exported today to the lake. It should be possible however to convert the (possibly, binary) data to text using the [Codeunit `Base64 Convert`](https://learn.microsoft.com/en-us/dynamics365/business-central/application/reference/system%20application/codeunit/system_application_codeunit_base64_convert) and then store it as a separate field in a new table and exporting it to the lake using the bc2adls solution.

### How do I export some tables at a different frequency than the rest?
Normally, all the tables that are setup for export will export at the same time. However you may invoke exports of selected tables by using the API pages available. The [issue #87](/issues/87) describes this possibility in more detail.
Yes you can have different frequencies for different tables. Just look into the line "How do I run the export to the lake in a recurring schedule?" above.

### How do I track the files in the `deltas` folder in my data lake container?
Incremental exports create files in the `deltas` folder in the lake container. Each such file has a `Modified` field that indicates the time when it was last updated, in other words, when the export process finished with that file. Each export process for an entity and in a company logs its execution on the [`ADLSE Run`](https://github.com/microsoft/bc2adls/blob/main/businessCentral/src/ADLSERun.Table.al) table using the `Started` and `Ended` fields. Thus you may tally the value in the `Modified` field of the file to these fields and determine which run resulted in creation of that file. You may also use telemetry to determine which run created which file.
Expand Down
Binary file added .assets/JQ_ReportOptions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .assets/JQ_ReportRequestPageOptions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .assets/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ This is the step that would create the analytics pipelines in the above workspac

6. At the toolbar of the **Synapse Studio** at the top, you may now click on **Validate all** and if there are no errors, click on **Publish all**.

### Step 7. Schedule export
You can also schedule the export. For each company you need to create Job Queue's. How you can do that you can read here:
[`How do I run the export to the lake in a recurring schedule`](https://github.com/Bertverbeek4PS/bc2adls/blob/main/.assets/FAQs.md#how-do-i-run-the-export-to-the-lake-in-a-recurring-schedule)

## Congratulations!
You have completed configuring the resources. Please proceed to running the tool and exporting BC data to data lake [here](/.assets/Execution.md).
Expand Down
6 changes: 5 additions & 1 deletion .assets/SetupFabric.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Let us take a look at the settings show in the sample screenshot below,
- **Translations** Choose the languages that you want to export the enum translations. You have to refresh this every time there is new translation added. This you can do to go to `Related` and then `Enum translations`.
- **Export Enum as Integer** The flag to enable or disable exporting the enum values as integers. It is set to False by default.
- **Add delivered DateTime** If you want the exported time in the CSV file yes or no.
- **Export Company Database Tables** Choose the company in which you want to export the DataPerCompany = false tables.
- **Export Company Database Tables** Choose the company in which you want to export the DataPerCompany = false tables. This gives better performance for exporting data of that or not on company level.

![Business Central Fabric](/.assets/businessCentralFabric.png)

### Step 6. Schedule export
You can also schedule the export. For each company you need to create Job Queue's. How you can do that you can read here:
[`How do I run the export to the lake in a recurring schedule`](https://github.com/Bertverbeek4PS/bc2adls/blob/main/.assets/FAQs.md#how-do-i-run-the-export-to-the-lake-in-a-recurring-schedule)
26 changes: 14 additions & 12 deletions businessCentral/app/src/ScheduleTaskAssignment.Report.al
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,23 @@ report 82561 "ADLSE Schedule Task Assignment"
Clear(JobQueueEntry);
JobQueueCategory.InsertRec(JobCategoryCodeTxt, Description);
JobQueueEntry.Init();
JobQueueEntry.Status := JobQueueEntry.Status::"On Hold";
JobQueueEntry.Validate("Object Type to Run", JobQueueEntry."Object Type to Run"::Report);
JobQueueEntry.Validate("Object ID to Run", Report::"ADLSE Schedule Task Assignment");
JobQueueEntry.Insert(true);

JobQueueEntry.Description := Description;
JobQueueEntry."No. of Minutes between Runs" := NoofMinutesBetweenRuns;
JobQueueEntry."Run on Mondays" := RunOnMondays;
JobQueueEntry."Run on Tuesdays" := RunOnTeusdays;
JobQueueEntry."Run on Wednesdays" := RunOnWednesdays;
JobQueueEntry."Run on Thursdays" := RunOnThursdays;
JobQueueEntry."Run on Fridays" := RunOnFridays;
JobQueueEntry."Run on Saturdays" := RunOnSaturdays;
JobQueueEntry."Run on Sundays" := RunOnSundays;
JobQueueEntry."Object Type to Run" := JobQueueEntry."Object Type to Run"::Report;
JobQueueEntry."Object ID to Run" := Report::"ADLSE Schedule Task Assignment";
JobQueueEntry."Earliest Start Date/Time" := EarliestStartDateTime;
JobQueueEntry.Validate("Run on Mondays", RunOnMondays);
JobQueueEntry.Validate("Run on Tuesdays", RunOnTeusdays);
JobQueueEntry.Validate("Run on Wednesdays", RunOnWednesdays);
JobQueueEntry.Validate("Run on Thursdays", RunOnThursdays);
JobQueueEntry.Validate("Run on Fridays", RunOnFridays);
JobQueueEntry.Validate("Run on Saturdays", RunOnSaturdays);
JobQueueEntry.Validate("Run on Sundays", RunOnSundays);

JobQueueEntry.Validate("Earliest Start Date/Time", EarliestStartDateTime);
JobQueueEntry."Report Output Type" := JobQueueEntry."Report Output Type"::"None (Processing only)";
JobQueueEntry.Insert(true);
JobQueueEntry.Modify(true);
end;
}

0 comments on commit 75ccf97

Please sign in to comment.