Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Clean Tenant Media

(2) ShareShare
ReportReport
Posted on by 17
Hi guys,

I need help, I have a storage problem in my central Business Central environment.



Analyzing the stored data, I have seen that we have the “Tenant Media” table oversized and I want to empty it completely.

 
 
 
I have tried using data administration and searching for orphaned files, but it does not find any more orphaned files.
 
 
 
 
I have also tried to delete the data by code, inserting a button in a page and it works but for a few days, after a few days Microsoft blocks this action and recovers the deleted data.
 
 
 
 
I need your help, thank you very much
 
Regards
Vicente
  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    690 on at
    Clean Tenant Media

    Hi Vicente,

    This behavior is by design—the Tenant Media table in Business Central stores media like images, documents, and binary data, with protective measures from Microsoft to prevent accidental deletion.

    To address this issue, instead of fully clearing the table, consider:

    • Identifying and removing unused/unnecessary records.
    • Following Microsoft’s best practices for media management.
    • Implementing cleanup procedures within customizations.
    • Using retention policies where applicable.

    For images specifically:

    • Compress them before storage.
    • Set size limits for uploads.
    • Company logo images are automatically maintained—avoid manual deletions as they’ll be restored.

    If emptying the table completely isn't possible, consider alternatives:

    • Setting up retention policies.
    • Using proper cleanup methods in your code.
    • Leveraging external storage (Azure Blobs, containers, OneDrive) for seamless integration with Business Central.

    Hope this helps! If you find this useful, feel free to mark it as a verified answer.

    Cheers,
    Jeffrey

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,402 Super User 2025 Season 1 on at
  • Suggested answer
    YUN ZHU Profile Picture
    84,562 Super User 2025 Season 1 on at
    Clean Tenant Media
    There is no way to stop what has already happened.
    You can communicate with the customer, for example, use AL Code to delete all Tenant Media and Change Logs created 3 years ago, to see if they can accept it.
    Tenant Media can be downloaded using the following method, and Change Log can also be exported to Excel first.
    Dynamics 365 Business Central: How to export all Media Contents (bmp, jpg,mp4…) from table 2000000184 “Tenant Media”
     
     
    Thanks.
    ZHU
  • Gerardo Rentería García Profile Picture
    19,937 Most Valuable Professional on at
    Clean Tenant Media

    Hi, good day
    I hope this can help you, and give you some hints.

    Solved: Tenant Media

    Solved: Tenant Media table id: 2000000184 growing exponentially

    Best Regards
    Gerardo

  • Peter76 Profile Picture
    2 on at
    Clean Tenant Media
    Hi Vincente,
     
    I think you have to clear the media fields which point to the tenant media.
     
    For instance:
    Look at table 1173 Document Attachments
     
    Clear the "Document Reference ID"
  • Vicente Pastor Profile Picture
    17 on at
    Clean Tenant Media
    Hi Zhu,

    Yeah, I know, that's why they now work with sharepoint. The problem is that this has been done years ago and I need to free up space, can you think of what to do?
     
    Regards
    Vicente
  • Suggested answer
    YUN ZHU Profile Picture
    84,562 Super User 2025 Season 1 on at
    Clean Tenant Media
    1.4TB over? Because your Tenant Media is in use, if you clear it, it will affect the data.
    If the company needs to manage a lot of attachments, it is recommended to use an external solution, such as the following.
    Dynamics 365 Business Central: Manage attachments in SharePoint (Save attachments externally and do not use BC capacity)
     
    Hope this helps.
    Thanks.
    ZHU
  • Vicente Pastor Profile Picture
    17 on at
    Clean Tenant Media
    Yes Rock, i try... but in the retention policies I cannot directly configure the table “Tenant Media”.
     
  • Suggested answer
    RockwithNav Profile Picture
    7,119 on at
    Clean Tenant Media
    Retention policy is a very nice feature which you can implement moving forward to auto clean the data.
    Currently Data Administration and then deletion is the best standard approach. Did you try executing this?
     
  • Vicente Pastor Profile Picture
    17 on at
    Clean Tenant Media
    I need to empty this table completely, I don't care if I lose the content.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans