Save Invoices to Azure Files From D365FO

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.

 

In v3.4.8, Docentric introduced support for Azure RBAC - to enhance security for saving reports to external Azure storage accounts. In Docentric setup for Azure storage accounts, you are now able to configure to which Azure resources (e.g. a blob container, a file share) can be accessed from D365FO. Until v3.4.8, Docentric only supported Full Access, i.e. access to all resources in an external Azure storage account. Learn more >>

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.

The newly created Azure file share will inherit the storage tier from the storage account.

Image below shows one possible setup of the Docentric File print destination, here are a few things to notice:

  1. Output filename: @InvoiceAccount@ @PARAMETER_DocumentTitle@ #@InvoiceId@.pdf
  2. Azure storage account: Docentric_Storage_Acc
  3. Azure file share: new-file-share
  4. Folder path: @CURRENTYEAR@/@CURRENTMONTH@
  5. Create non-existing file share: Yes
  6. 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.

Result

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 >>

One thought on “Save Invoices to Azure Files From D365FO

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Docentric respects your privacy. Learn how your comment data is processed >>

Docentric respects your privacy. Learn how your comment data is processed >>