Azure Cosmos DB Always Encrypted and GetItemLinqQueryable issue
Reading Azure Cosmos DB Always Encrypted issue
When following Microsoft’s article on client-side encryption in Azure Cosmos DB and using the GetItemLinqQueryable method, you may encounter decryption issues. To resolve this, swap out ToFeedIterator with ToEncryptionFeedIterator from Microsoft.Azure.Cosmos.Encryption.EncryptionContainerExtensions. Here’s an example:
var queryable = _container.GetItemLinqQueryable<TBaseEntity>().AsQueryable();
// Convert to feed iterator
using FeedIterator<TResult> linqFeed = _container.ToEncryptionFeedIterator(query);