Hello Harpeet !
Thank you for posting on Microsoft Learn Q&A.
Cosmos DB recently added support in the control plane for defining a dataMaskingPolicy object on a container.
When you use the Portal or some SDK/ARM to update the container (for example to change TTL), the request body that gets sent can include all container properties including dataMaskingPolicy.
If your account does not have data masking enabled, Cosmos will reject any request that even mentions that property even if you're not trying to turn it on.
If you use the Cosmos DB REST API or ARM template/PUT call and only send the allowed properties (like defaultTtl) without any dataMaskingPolicy, the update should succeed.
For a Core (SQL) API container, the body for replace container looks like this shape:
{
  "id": "TestTTL",
  "partitionKey": {
    "paths": ["/yourPartitionKey"],
    "kind": "Hash"
  },
  "defaultTtl": 3600
}
I