NotFound (404) on Cosmos Query Execution

Shreekumar Suggamad 141 Reputation points
2022-09-03T10:58:45.027+00:00

Getting the below error

Microsoft.Azure.Cosmos.CosmosException: 'Response status code does not indicate success: NotFound (404); Substatus: 0; ActivityId: 9cb22e39-4d37-472e-b650-6033281e5585; Reason: (Response status code does not indicate success: NotFound (404); Substatus: 0; ActivityId: 9cb22e39-4d37-472e-b650-6033281e5585; Reason: (Response status code does not indicate success: NotFound (404); Substatus: 0; ActivityId: 9cb22e39-4d37-472e-b650-6033281e5585; Reason: (  
Errors : [  
  "Resource Not Found. Learn more: https://aka.ms/cosmosdb-tsg-not-found"  
]  
);););'  

On execution of the below code (at Line number 7)

public List<int>  Run([ActivityTrigger] IDurableActivityContext inputs, ILogger log)  
        {  
            try  
            {  
                container = _repository.GetContainer();  
  
                var stores = container .Where(d =>  
                    d.CreatedDate >= _yesterday.Date && d.CreatedDate < _today.Date  
                ).ToList().DistinctBy(x => x.storeId).Select(s => s.storeId).ToList();  
  
                return stores;  
            }  
            catch (Exception ex)  
            {  
                log.LogError(ex, $"Error processing function.");  
                throw;  
            }  
        }  
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,691 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.