{"title":"Store document attachments in external file storage","url":"https://jonas-paprotka.de/docs/across-store-document-attachments-externally/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/across-store-document-attachments-externally, MicrosoftDocs/dynamics365smb-docs at 46907ac (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/across-store-document-attachments-externally","source":{"name":"Business Central application docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-docs","commit":"46907ace177f8d31deba47a2fdb57c3336e66252","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to store document attachments in Azure or SharePoint external file storage to reduce database usage in Business Central.","date":"2026-11-10","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Store document attachments in external file storage","slug":"store-document-attachments-in-external-file-storage","at":0,"chars":15787},{"level":2,"title":"Supported external storage providers","slug":"supported-external-storage-providers","at":1353,"chars":980},{"level":2,"title":"Set up an external file storage account","slug":"set-up-an-external-file-storage-account","at":2333,"chars":5973},{"level":3,"title":"Register an app for SharePoint storage","slug":"register-an-app-for-sharepoint-storage","at":2770,"chars":5536},{"level":2,"title":"Enable external storage for document attachments","slug":"enable-external-storage-for-document-attachments","at":8306,"chars":3027},{"level":2,"title":"Work with attachments after you offload them","slug":"work-with-attachments-after-you-offload-them","at":11333,"chars":479},{"level":2,"title":"Attach a file to a record when external storage is enabled","slug":"attach-a-file-to-a-record-when-external-storage-is-enabled","at":11812,"chars":1236},{"level":2,"title":"View or download an attached file","slug":"view-or-download-an-attached-file","at":13048,"chars":889},{"level":2,"title":"Delete an attached file","slug":"delete-an-attached-file","at":13937,"chars":466},{"level":2,"title":"Move or copy records","slug":"move-or-copy-records","at":14403,"chars":1165},{"level":2,"title":"Related information","slug":"related-information","at":15568,"chars":219}],"text":"# Store document attachments in external file storage\nBusiness Central lets you store document attachments, such as PDFs, images, and scanned documents, outside the Business Central database. For example, in external file storage such as Microsoft Azure or SharePoint. By offloading attachments to a connected external storage service, you can significantly reduce your database size and avoid reaching storage limits. You can access attachments in Business Central, but the files are in your external storage account.\nKeeping attachments in external storage can help you:\n Stay within capacity limits. Each Business Central tenant has a database capacity allowance that's shared across its production and sandbox environments. The allowance includes 80 GB of base capacity plus extra capacity per licensed Essentials or Premium user. Offloading attachments can reduce the need to purchase extra capacity. See Managing capacity<dev-itpro/administration/tenant-admin-center-capacity>.\n Improve performance and backups. A smaller database can improve overall system performance and reduce backup and restoration times.\n Use inexpensive storage. External cloud storage such as Azure Blob Storage or SharePoint is typically more cost-effective for large file storage and can provide other features like sharing, content management, and long-term archiving.\n## Supported external storage providers\nOut of the box, Business Central supports Azure cloud storage and Microsoft 365 services for external attachments. You can connect to Azure Blob Storage, Azure File Share, or SharePoint document libraries. The External File Storage framework is extensible, so partners or developers can add other storage providers (for example, SFTP or OneDrive) via extension if needed.\n> IMPORTANT\n> You're responsible for your data management. When you enable external storage for attachments, files are no longer stored in the Business Central database. Instead, they reside in your external storage. This means Microsoft doesn't back up or manage those files as part of your Business Central environment. You, or your system administrator, are responsible for setting up appropriate backups and access control on the external storage. If a file is deleted or becomes unavailable in external storage, you can no longer access it from Business Central.\n## Set up an external file storage account\nBefore you can offload attachments, you must create one or more external file accounts in Business Central for the storage services you plan to use. An external file account stores the connection details, such as credentials and endpoints, for your Azure or SharePoint storage. You can set up multiple external file accounts. For example, one for Azure Blob Storage and another for SharePoint.\n### Register an app for SharePoint storage\nBefore you add a SharePoint storage account, register an app in Microsoft Entra ID and grant it permissions for the connector mode and authentication type that you use. The app registration permissions depend on whether the account uses the default Microsoft Graph API or the legacy SharePoint REST API. Grant only the permissions needed for the sites that Business Central accesses.\nConnector mode|Authentication type|Least-privileged permission for full connector functionality|Tenant-wide alternative\nMicrosoft Graph (default)|Client Secret or Certificate|Microsoft Graph application permission Sites.Selected and a write role granted for each site that the connector accesses|Microsoft Graph application permission Sites.ReadWrite.All\nLegacy SharePoint REST API|Certificate|SharePoint application permission Sites.Selected and a write role granted for each site that the connector accesses|SharePoint application permission Sites.ReadWrite.All\nLegacy SharePoint REST API|Client Secret|SharePoint delegated permission AllSites.Write; this is a tenant-wide scope, but access is also limited by the signed-in user's SharePoint permissions|None; AllSites.Write is the minimum tenant-wide scope\nThe connector requires write access because it can upload, copy, move, and delete files and folders. It doesn't require permission to administer sites or manage permissions.\nThe connector first resolves the SharePoint site and then its default document library. These operations require site-level access. Therefore, the supported minimum is the Sites.Selected scope with a role grant on each site that the account uses. The connector doesn't support Lists.SelectedOperations.Selected, ListItems.SelectedOperations.Selected, or Files.SelectedOperations.Selected as alternatives.\nSites.Selected grants no access by itself. A SharePoint administrator must also grant the app the write role on every site that the connector accesses. The administrator can create the site-specific grants by using Microsoft Graph PowerShell, Microsoft 365 CLI, or Microsoft Graph. The app or administrator that creates these grants needs separate permission to manage site permissions; the connector app doesn't need that elevated permission.\nThe connector resolves the site and its default document library before accessing files and folders. Therefore, use the site-level Sites.Selected permission rather than narrower list-, folder-, or file-level selected permissions.\nFor legacy SharePoint REST API accounts, site-scoped folder creation requires Business Central 28.1 or later. In Business Central 28.0 and earlier, folder creation requests context information from the tenant root site, so the app must also be granted access to the root site.\nSee Overview of Selected Permissions in OneDrive and SharePoint<https://learn.microsoft.com/graph/permissions-selected-overview> and Understanding Resource Specific Consent for Microsoft Graph and SharePoint Online<https://learn.microsoft.com/sharepoint/dev/sp-add-ins-modernize/understanding-rsc-for-msgraph-and-sharepoint-online>.\n1. Select Search (Alt+Q) in the upper-right corner, enter External File Accounts, and choose the related link.\n1. Choose the Add a file account action to start a setup guide that helps you enter details for your external storage connection.\n1. Choose Next to open the storage provider selection.\n1. Select the type of storage you want to connect (for example, Azure Blob Storage, Azure File Share, or SharePoint), and then choose Next.\n1. Enter the required connection details. The details depend on the storage type you selected.\n  Azure Blob Storage account: Enter an Account Name, which is a friendly name for use in Business Central, and the Storage Account Name of your Azure storage account. Select the Authorization Type, either a Shared Access Signature (SAS) token or a shared account key. Paste the SAS token or access key in the Secret field. Specify the Container Name where you store attachments in your blob storage account.\n  Azure File Share account: Enter an Account Name and the Storage Account Name. Choose the authentication method (SAS token or key) and provide the Secret value. Enter the File Share Name for the Azure Files share where you store attachments.\n  SharePoint storage account: Enter an Account Name for Business Central, and then provide the Tenant ID, Client ID, and authentication credentials for the Microsoft Entra app registration that has access to your SharePoint site. In SharePoint Name, enter the complete site URL, such as `https://contoso.sharepoint.com/sites/ProjectX`. Specify the Base Relative Folder Path where you want to store attachments.\n> TIP\n> The folder path depends on the API. With the default Microsoft Graph API, enter a path relative to the default document library, such as Attachments. Don't include the site path or document library name. With the legacy SharePoint REST API, enter the full server-relative path, such as `/sites/ProjectX/Shared Documents/Attachments`.\n1. Choose Next.\n1. Review the information, and choose Finish. Business Central saves the new external file account. You can repeat these steps to add multiple storage accounts if needed. For example, if you want to connect to both an Azure storage and a SharePoint library. The External File Accounts page lists all configured accounts.\nAt this point, you're connected to your external storage. Next, enable document attachment features to use one of your external file accounts to store attachments.\n## Enable external storage for document attachments\nAfter you set up a file account for external storage, the next step is to assign the document attachments scenario to it. This step tells Business Central to offload attachments to the storage instead of the database.\n1. Select Search (Alt+Q) in the upper-right corner, enter File Scenario Assignment, and choose the related link.\n1. Select the file account, and then choose Assign scenarios.\n1. Select the Document Attachments - External Storage file scenario. Confirm that you want to configure storage for document attachments.\n1. After you confirm, the External Storage Setup page opens. Set up how to offload attachments:\n  Turn on the Enabled toggle for the Document Attachments scenario. This setting confirms that Business Central offloads attachments to the specified storage. Business Central displays a warning that using external storage is at your own risk and that you're responsible for managing and backing up the files. Read the warning, and then choose Yes to proceed. The Document Attachments scenario is now active.\n  In the Root Folder field, choose an existing folder in your external storage. Business Central creates a subfolder identified by a hash of the tenant, environment, and company, followed by a folder for the source table. For example, attachments for sales orders use a Sales_Header folder.\n  Review External Cleanup Status. In Business Central 29, external file deletion is blocked. Delete External File on Attachment Delete displays the saved policy but isn't editable. Deleting an attachment record doesn't delete its external file.\n1. Review your settings, and then choose Close to complete the scenario setup. The Document Attachments feature is now linked to your external storage account. From this point on, new attachments you add to records in Business Central are stored in the external location instead of the Business Central database.\n> NOTE\n> Only attachments people add after you enable this feature are kept in your external storage. To move existing attachments from your Business Central database to external storage, go to the File Scenarios or External Storage Setup pages and use the Storage Sync action. You can specify the direction you want to move files, and the operation to do so.\n> To stop using external storage, run Storage Sync with Sync Direction set to To Internal Storage and Operation set to Move. After confirming that an attachment has nonempty internal file content, the operation removes its local reference to external storage. The external file is retained. Copy restores internal content but keeps the external reference. You can also use Retire External Reference on the Document Attachments - External Storage page after restoring the internal content.\n> You can't turn off external storage, unassign the scenario, or change its file account while attachments still reference external files. Resolve any synchronization errors and retire the remaining references before you make these changes.\n## Work with attachments after you offload them\nDocument attachment features don't change for users after you enable external file storage. You still manage attachments by using the Attachments FactBox on records, or the Attached Documents page, as usual. The difference is behind the scenes. When you attach a file, Business Central uploads it to your external storage. When you view or download an attachment, Business Central retrieves it from external storage automatically.\n## Attach a file to a record when external storage is enabled\nAttach files to records by using the Attachments tab on the FactBox, or the Attachments action on the Lines FastTab for line-level attachments. This process works the same way as with standard attachments. For example, on the Sales Order page, select Documents > Upload files and select a file from your device. The file appears in the Documents section of the FactBox.\n If you configure external storage for attachments, Business Central immediately transfers the file to the external file account you set up.\n Business Central ensures that each file name is unique in the external storage by appending a unique ID to the file name. The ID prevents different records with the same original file name from overwriting each other in a flat storage container. For example, it gives two different invoices named invoice.pdf distinct names in the external storage. The attachment's title in Business Central remains the original file name without the unique ID, but the file in external storage has the ID.\n> NOTE\n> If an automatic upload fails, the file remains in internal storage. Use Storage Sync and review the reported errors to retry attachments that aren't transferred.\n## View or download an attached file\nTo view an attachment, select its name in the Documents section of the Attachments FactBox. Business Central gets the file from external storage automatically. Supported PDF and image files open in preview mode, so you can review them without downloading them first. If you want to save a copy, use the Download action in the previewer. Other file types download to your device, where you can open them. On the Document Attachments - External Storage page, use Download to save the selected file.\nSupported image formats include JPEG, JPG, PNG, BMP, SVG, WEBP, ICO, GIF, and AVIF. GIF and AVIF formats include support for animated files. On Safari, TIFF and TIF images are also supported.\n> NOTE\n> If the file doesn't exist in the external storage, for example, because you deleted it, an error displays because the link is broken in Business Central.\n## Delete an attached file\nTo remove an attachment, delete its row in the Documents section of the FactBox or on the Attached Documents page. Business Central deletes the attachment record from its database. In Business Central 29, the external file is retained regardless of the saved deletion policy. No external cleanup is scheduled. Manage any later cleanup in your external storage, and verify that no other records still reference the file before deleting it.\n## Move or copy records\nIf you use features like Copy Company or environment backup and restore, keep in mind that attachments you store externally aren't automatically copied. The attachment records (metadata) might be copied, but they still point to files in the original external storage location unless you migrate those files manually. To do so, go to the External Storage Setup page, and run the Migrate Files action. This report copies files to the current environment and company folder and updates the attachment references. The original external files are retained.\n> NOTE\n> You can browse and manage your external file storage from within Business Central. On the External File Accounts page, select your storage account, and choose the Storage Browser action to open the External Storage Browser page. This page displays the folders and files in your connected storage. It shows all files in a selected Azure blob container, and allows you to upload, download, or delete files. You can also create new folders in the external storage. This page can be useful for verifying that files are saving as expected, or for manually managing external documents.\n## Related information\nWork with Business Central<ui-work-product>\nadmin-setup-and-administration\nFind free e-learning modules for Business Central here<https://learn.microsoft.com/training/dynamics365/business-central>"}