This article presents a new option in Docentric File print destination, saving reports to configurable Azure file shares. We will demonstrate it using the example of the Sales invoice report and to make it even more interesting, we will create a non-existing Azure file share on-the-fly.
Precondition: Azure File storage
With the Docentric Free edition you can use the D365FO Azure File storage, while with Full Edition you can use Azure Files on any other Azure storage account. For this article we will work with an external Azure storage account.
In our example we already have one file share in this Azure File storage. We will need Access keys to configure access to this Azure File storage in Docentric AX Workspace > Related > Azure settings > Azure storage accounts.
Docentric File print destination, option: Save to Azure Files
If we know the Connection string for the external Azure storage account, we can do powerful things directly from the Docentric File print destination, including creating a new Azure file share.
Image below shows one possible setup of the Docentric File print destination, here are a few things to notice:
- Output filename: @InvoiceAccount@ @PARAMETER_DocumentTitle@ #@InvoiceId@.pdf
- Azure storage account: Docentric_Storage_Acc
- Azure file share: new-file-share
- Folder path: @CURRENTYEAR@/@CURRENTMONTH@
- Create non-existing file share: Yes
- Create non-existing folders: Yes
When saving reports to Azure Files, additional costs may be incurred if the target Azure file shares don’t exist and should be created first. That’s why we introduce a configuration setting Creation of non-existing file shares in Docentric AX parameters > Print destinations > File print destination, with the options: Configurable, Enforced and Forbidden.
Only the Configurable option gives users a possibility to configure on the form Print destination settings > Save to Azure Files > Create non-existing folders whether to create a non-existing Azure file share or not. The Enforced option will create all non-existing Azure file shares automatically, while Forbidden will cause that a non-existing Azure file share will not be created and report will not be saved to Azure Files.
After printing an invoice, this is the info message we get:
Report (Show invoice) with ID (SalesInvoice.Report) is successfully saved to Azure Files (Azure storage account: Docentric_Storage_Acc, file share: new-file-share, folder path: 2022/01). Report output filename: US-001 Invoice #CIV-000350.pdf.
And the result on Azure storage shows the newly created file share:
In this file share we see the folder structure and file name based on the resolved placeholders in the setup:
There is more
Saving to Azure Files also enables routing of generated reports from the D365FO in the cloud to local network. Read article: Save Invoices to Local File System from D365FO in Cloud >>