Until recently, Fabric Mirrored Databases data retention (OneLake) was of 7 days (default) and it was not possible to change this property. Fabric May 2025 Feature Summary | Microsoft Fabric Blog | Microsoft Fabric
As of today, the default retention period for such artifacts created after June 2025 is of 1 day. And you can also change it, via UI and APIs.
This means that for previously created artifacts, you have the freedom to reduce that retention period, if you are concerned with OneLake storage consumption, or to extend it, should you be interested in extending the history, to travel further in time, with Delta.
This data retention is ruled by the retentionInDays property of the mirrored database definition, which can take values between 1 – 30.
It is already possible to change this value through the UI, via the artifact settings:

The API way
First, it’s important to talk about the important information needed to carry out the operation.
When you open your Mirrored database artifact, you can easily retrieve your workspace id and mirrored database id from the URL of that page:
https://app.powerbi.com/groups/<workspace-id>/mirroreddatabases/<mirrored-database-id>
In this demo, I will use the Try It option on each API page, involving manual steps, for illustration purposes. Of course, you can use this approach with any client of your choice with which you can perform web requests.
In order to update the data retention policy, we need to change the mirrored database definition.
We should distinguish right from the start the mirrored database (Items – Get Mirrored Database – REST API (MirroredDatabase) | Microsoft Learn – illustrated above) and the mirrored database definition.
Example of a request to get the mirrored database: https://learn.microsoft.com/en-us/rest/api/fabric/mirroreddatabase/items/get-mirrored-database?tabs=HTTP

Response:

The important part, to update the data retention property, is the definition and looks like the following, for the same artifact: Items – Get Mirrored Database Definition – REST API (MirroredDatabase) | Microsoft Learn
{
"definition": {
"parts": [
{
"path": "mirroring.json",
"payload": "ew0KICAicHJvcGVydGllcyI6IHsNCiAgICAic291cmNlIjogew0KICAgICAgInR5cGUiOiAiQXp1cmVTcWxNSSIsDQogICAgICAidHlwZVByb3BlcnRpZXMiOiB7DQogICAgICAgICJjb25uZWN0aW9uIjogImFlNDRhNTVhLTA2YjktNGQ0Zi05Y2VhLTBlMmYzM2FmNDIwMyIsDQogICAgICAgICJsYW5kaW5nWm9uZSI6IHsNCiAgICAgICAgICAidHlwZSI6ICJNb3VudGVkUmVsYXRpb25hbERhdGFiYXNlIiwNCiAgICAgICAgICAidHlwZVByb3BlcnRpZXMiOiB7fQ0KICAgICAgICB9DQogICAgICB9DQogICAgfSwNCiAgICAidGFyZ2V0Ijogew0KICAgICAgInR5cGUiOiAiTW91bnRlZFJlbGF0aW9uYWxEYXRhYmFzZSIsDQogICAgICAidHlwZVByb3BlcnRpZXMiOiB7DQogICAgICAgICJkZWZhdWx0U2NoZW1hIjogImRibyIsDQogICAgICAgICJmb3JtYXQiOiAiRGVsdGEiDQogICAgICB9DQogICAgfQ0KICB9DQp9",
"payloadType": "InlineBase64"
},
{
"path": ".platform",
"payload": "ewogICIkc2NoZW1hIjogImh0dHBzOi8vZGV2ZWxvcGVyLm1pY3Jvc29mdC5jb20vanNvbi1zY2hlbWFzL2ZhYnJpYy9naXRJbnRlZ3JhdGlvbi9wbGF0Zm9ybVByb3BlcnRpZXMvMi4wLjAvc2NoZW1hLmpzb24iLAogICJtZXRhZGF0YSI6IHsKICAgICJ0eXBlIjogIk1pcnJvcmVkRGF0YWJhc2UiLAogICAgImRpc3BsYXlOYW1lIjogImFjc2lsdmEtZGIiCiAgfSwKICAiY29uZmlnIjogewogICAgInZlcnNpb24iOiAiMi4wIiwKICAgICJsb2dpY2FsSWQiOiAiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIgogIH0KfQ==",
"payloadType": "InlineBase64"
}
]
}
}
We can see two definition parts, being the first one, the relevant one for this use case. Not to forget, both payloads are base64 encoded.
To encode/decode payloads, we can use the online tools https://www.base64encode.org/ / https://www.base64decode.org/ , respectively.
Decoding the mirroring.json payload, this is how it looks like:
{
"properties": {
"source": {
"type": "AzureSqlMI",
"typeProperties": {
"connection": "ae44a55a-06b9-4d4f-9cea-0e2f33af4203",
"landingZone": {
"type": "MountedRelationalDatabase",
"typeProperties": {}
}
}
},
"target": {
"type": "MountedRelationalDatabase",
"typeProperties": {
"defaultSchema": "dbo",
"format": "Delta"
}
}
}
}
The JSON property retentionInDays is not exposed, as this artifact had been created before June 2025 (https://learn.microsoft.com/en-us/fabric/database/mirrored-database/overview#retention-for-mirrored-data:~:text=Fabric%20portal%20after-,mid%2DJune%202025,-%2C%20the%20default%20retention)
Manually adding the property of interest:
{
"properties": {
"source": {
"type": "AzureSqlMI",
"typeProperties": {
"connection": "ae44a55a-06b9-4d4f-9cea-0e2f33af4203",
"landingZone": {
"type": "MountedRelationalDatabase",
"typeProperties": {}
}
}
},
"target": {
"type": "MountedRelationalDatabase",
"typeProperties": {
"defaultSchema": "dbo",
"format": "Delta",
"retentionInDays": 1
}
}
}
}
Proceeding to encode to base64 (using the encode tool shared above), we get the new encoded payload:
ewogICJwcm9wZXJ0aWVzIjogewogICAgInNvdXJjZSI6IHsKICAgICAgInR5cGUiOiAiQXp1cmVTcWxNSSIsCiAgICAgICJ0eXBlUHJvcGVydGllcyI6IHsKICAgICAgICAiY29ubmVjdGlvbiI6ICJhZTQ0YTU1YS0wNmI5LTRkNGYtOWNlYS0wZTJmMzNhZjQyMDMiLAogICAgICAgICJsYW5kaW5nWm9uZSI6IHsKICAgICAgICAgICJ0eXBlIjogIk1vdW50ZWRSZWxhdGlvbmFsRGF0YWJhc2UiLAogICAgICAgICAgInR5cGVQcm9wZXJ0aWVzIjoge30KICAgICAgICB9CiAgICAgIH0KICAgIH0sCiAgICAidGFyZ2V0IjogewogICAgICAidHlwZSI6ICJNb3VudGVkUmVsYXRpb25hbERhdGFiYXNlIiwKICAgICAgInR5cGVQcm9wZXJ0aWVzIjogewogICAgICAgICJkZWZhdWx0U2NoZW1hIjogImRibyIsCiAgICAgICAgImZvcm1hdCI6ICJEZWx0YSIsCiAgICAgICAicmV0ZW50aW9uSW5EYXlzIjogMQogICAgICB9CiAgICB9CiAgfQp9Cg==
This encoded payload can now be used to update the definition, by replacing the previous payload: Items – Update Mirrored Database Definition – REST API (MirroredDatabase) | Microsoft Learn
In green, just for illustration purposes, we can see the encoded payload, containing the updated property: retentionInDays

To which we got a valid response:

In order to prove that, we can get back to the artifact, and check through the UI the new retention period:

As the time of writing, you get 1 terabyte of mirroring storage for every capacity unit on your capacity. A F2 capacity will have 2 tb of free storage, for mirroring, and so on. With this approach, you have more control over the storage consumption, for previously created artifacts or you can extend your time travel capability range.
I hope you found this post useful.
Relevant links: https://learn.microsoft.com/en-us/fabric/database/mirrored-database/mirrored-database-rest-api
https://learn.microsoft.com/en-us/fabric/database/mirrored-database/overview
https://learn.microsoft.com/en-us/fabric/database/mirrored-database/overview#cost-of-mirroring