CosmosDB Request charge differs dramatically for same query, same collection - azure

I have a collection of 7 documents. 6 docs are about 1kb size and one is about 15kb.
Documents have a field named Email.
In Azure portal, in CosmosDB data explorer, i do simple query:
{"Email":/^co*/}
This returns all documents whose Email property starts with co (in this case its always 1 document returned). Now, when i run this query repeatedly, i get RU charges that vary from 6.98 to 104.99!
I emphasise, all of this happen in CosmosDB data explorer in Azure portal. Collection doesn't change during test. Noone else does any db queries while i am running tests.
Now this is complete mistery for me. I thought request charge is deterministic and that if collection and query don't change that request charge would be the same. This is 15 times different.
Does anyone have any explanation?

Related

Get total sold of product variant from Shopify's API

I am trying to retrieve total of sold products variants (Like how we see them in the dashboard reports) from Shopify's dashboard via API.
I checked orders API documentation but it seems like it doesn't have any filter or endpoint that would returns that data.
I am not sure if it is possible via Shopify GraphQl or ShopifyQL.
In the documentation of ShopifyQL it says
(The Analytics API is deprecated. Please use our other APIs to get Sales, Payments, Taxes, and Customer data.)
Anybody knows how to access to that data in anyway?

payPal subscription transactions not showing up immediately

I'm creating recurring payments through payPal subscriptions flow. On the frontend, I have a button auto-generated by payPal which redirects me to their domain. After that, it correctly returns the subscriptionID; after that, the frontend calls a backend API which should verify that subscriptionID, to check fields such "status" and so on.
In this backend API, I need to store some "paymentID" (one per month, always unique, if the subscription is automatically renewed monthly), which I found to be called "transactionID" on payPal. I use the REST API GET /v1/billing/subscriptions/{id}/transactions, which should returns an object with a field transactions, which should be an array of transactions. The problem is that sometimes, just after the successful payment, this array is empty. If I wait some time (from few ms to minutes), then every subscription has it's own transactions, in the end.
Is there a way to fix this? Or, alternatively, is there something like transactions on the PayPal environment which can uniquely represents a specific payment?
When a subscription starts it takes time for the first transaction to be created.
Instead of querying the subscriptions API, create a webhook to be notified of PAYMENT.SALE.COMPLETEDevents. This will be useful for the initial transaction as well as all future transactions.

Is there a way to bulk process customer data in Stripe?

I have a long list of old customers (>10K) in Stripe for which I would like to give a new trial period. Is there a way to bulk process those or we have to do that manually one by one?
I guess this depends entirely on what exactly you mean by 'new trial'. Do these customers have pre-existing Stripe subscriptions?
There's really no way to do this via the dashboard. However if there are no pre-existing subscriptions, you could programmatically create subscriptions for each customer object accordingly. You can specify the trial period on the price or on a per subscription basis.
As there are no batch endpoints for these operations, please be wary of the rate limiting if working with the API in this way

Luis Out of call volume quota

I have a Luis application and I am using the starter key for development. I am getting
Out of call volume quota. Quota will be replenished in xxxxxxxx.
I know that you have 1000 query per month but I only used 188 ( value on the dashboard). Is there another reason for getting out of Quota?
Are you working with the starter key?
The starter key only allows 1000 calls per month and doesn't work fine.
Here you have an extract from Microsoft FAQ:
Why did I get an email saying I'm almost out of quota?
Your authoring/starter key is only allowed 1000 endpoint queries a month.
Create a LUIS subscription key (free or paid) and use that key when
making endpoint queries. If you are making endpoint queries from a bot
or another client application, you need to change the LUIS endpoint
key there.
Check this to know how to create a LUIS Key.

Azure Billing Usage API Aggregate functionality is not working

I am using Azure billing API (Resource Usage-Preview) for getting the consumption data for an Azure subscription and trying to get the aggregated data of particular dates on daily basis. As per the documentation, I am sending showDetails parameter as false while calling API which defines the data should be aggregated, but not able to get aggregated data. In order to make sure the issue I stored data in database and found duplicate entries for the same subscriptionId, meterId, usageStartTime and usageEndTime which seems not correct and also irrespective of the value of showDetails (true or false) parameter I am getting same number of records which all are not aggregated.
Url which i am using :
https://management.azure.com/subscriptions/My SubscriptionId/providers/Microsoft.Commerce/UsageAggregates?api-version=2015-06-01-preview&reportedstartTime=2016-03-02+00%3a00%3a00Z&reportedEndTime=2016-03-03+00%3a00%3a00Z&aggregationGranularity=Daily&showDetails=false
Does anyone has faced the same issue or have any idea on this please?

Resources