as i mentioned in the topic i need to run a trigger only first 5 days of each month. Any ideas how to do it?
I tried to check with Recurrence trigger but did not find how to do it.
Thanks in advance.
Looking at the Recurrence documentation, it looks like you can specify a monthly recurrence with monthDays using the JSON definition.
Worth trying something like :
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Month",
"interval": 1,
"schedule": {
"monthDays": [1, 2, 3, 4, 5]
}
},
"type": "Recurrence"
}
}
While setting this up, keep in mind the following though :
Related
Title says it all. The evaluatedRecurrence property of Logic App triggers is undocumented and not settable through the logic app designer. It seems redundant.
I can find no answer to this question and not even a similar question. The only thing I can find is in the Readme of this repo, where the option "IncludeEvaluatedRecurrence" says "this is a non documented object".
So, my question(s) is/are:
What is this property?
How does it compare to the "normal" recurrence property?
Does every evaluation count as an action?
Example code:
"triggers": {
"Every_x_minutes": {
"recurrence": {
"frequency": "Minute",
"interval": "#parameters('RunFrequencyMinutes')",
"timeZone": "W. Europe Standard Time"
},
"evaluatedRecurrence": {
"frequency": "Minute",
"interval": 3,
"timeZone": "W. Europe Standard Time"
},
"type": "Recurrence"
}
}
What is this property?
The EvaluatedRecurrence property is when the recurrence trigger is being referenced by any expression or parameter. In general, it remains the same as recurrence unless it doesn't have any references.
How does it compare to the "normal" recurrence property?
When the trigger is referenced by any expression or parameter it will be evaluated under "evaluatedRecurrence". The "normal" recurrence property is something that will be triggered at times as we scheduled.
Does every evaluation count as an action?
Not necessarily, unless it is referenced by some parameter.
You can also follow Can't find the meaning/definition and example of trigger property called "evaluatedRecurrence" for further information.
I have an Azure Data Factory (v2) that I use to backup the contents of a database to a blob store nightly (2am UTC). However, I expect the name of the file to contain the day of the month (dd) that the backup was generated, but it's always the day before.
The file name is generated using an expression -
#{formatDateTime(pipeline().parameters.windowStart,'dd')}.json
So for example the run at 3am today should have been called 23.json, but it was actually called 22.json. 3am is the expected run time as I'm in the UK, which is currently on BST (UTC+1)
Looking at the parameters of the run, I can see that the windowStart is indeed a day out. For example, todays run which was triggered at 2am on the 23rd had 9/22/2020 2:00:00 AM.
Is anybody able to explain why Data Factory is behaving in this way, and hopefully how I can make it work as expected.
Here is the trigger as exported from the Data Factory.
{
"name": "Trigger_Copy_Transactions",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipeline": {
"pipelineReference": {
"referenceName": "Copy_Transactions",
"type": "PipelineReference"
},
"parameters": {
"windowStart": "#trigger().outputs.windowStartTime"
}
},
"type": "TumblingWindowTrigger",
"typeProperties": {
"frequency": "Hour",
"interval": 24,
"startTime": "2020-08-24T02:00:00Z",
"delay": "00:00:00",
"maxConcurrency": 50,
"retryPolicy": {
"intervalInSeconds": 30
},
"dependsOn": []
}
}
}
One thing you could try is to force the file to be generated in the same time zone that your IR is running in. For example we have a Self Hosted IR so when we would generate files it would not match EST times. In that case I did the following:
#concat('File_name',formatDateTime(
convertFromUtc(utcnow(),'Eastern Standard Time'),'yyyy-MM-dd'),'.txt')
Perhaps doing that would force the proper date?
Are you also using Auto-generated IR or Self-Hosted IR when running this job?
I am using ADF V1 in Azure.
I want my pipeline to run every Tuesday at 10:00AM. I know how to set the time but how to set particular day of the week in dataset and pipeline?.
I want my pipeline to run every Tuesday 10:00 AM.
my sample data set
{
"$schema": "http://datafactories.schema.management.azure.com/internalschemas/2015-09-01/Microsoft.DataFactory.table.json",
"name": "SQL-My-Table-DS",
"properties": {
"structure": [
{
"name": "ServiceName",
"type": "String"
}
],
"published": false,
"type": "SqlServerTable",
"linkedServiceName": "MyLinkedService",
"typeProperties": {
"tableName": "[common].[MyTable_Staging]"
},
"availability": {
"frequency": "Week",
"interval": 1,
"offset": "00:00:10"
},
"external": false,
"policy": {}
}
}
If you are using data factory version 1, you can achieve this by setting the availability with frequency month, interval 1, and set the offset with the number of the day you want the pipeline to run.
For example if you want it to run the 9th of each month as you said, you will have something like this:
"availability": {
"frequency": "Month",
"interval": 1,
"offset": "9.00:00:00",
"style": "StartOfInterval"
}
Editing the answer for week also, below code snippet will make pipeline to run every Tuesday.
"availability": {
"frequency": "Week",
"interval": 1,
"offset": "2.00:00:00",
"style": "StartOfInterval"
}
I've implemented a Azure DF Job which executes a SQL Stored Proc:
{
"name": "spLoggingProc",
"properties": {
"activities": [
{
"type": "SqlServerStoredProcedure",
"typeProperties": {
"storedProcedureName": "logging"
},
"outputs": [
{
"name": "spEmptyOutput15-4"
}
],
"scheduler": {
"frequency": "Hour",
"interval": 1
},
"name": "spLogging"
}
],
"start": "2017-01-01T00:00:00Z",
"end": "2099-01-01T00:10:00Z",
"isPaused": false,
"hubName": "dwh_hub",
"pipelineMode": "Scheduled"
}
}
The dataset:
{
"name": "spEmptyOutput15-4",
"properties": {
"published": false,
"type": "AzureSqlTable",
"linkedServiceName": "DWH",
"typeProperties": {
"tableName": "spEmptyOutput15-4"
},
"availability": {
"frequency": "Hour",
"interval": 1
}
}
}
The problem is now, the Proc runs every 2-3 seconds. But frequency is set to every hour. My goal is, to run every hour and every day the proc.
Can anyone please help me?
Thanks a lot!
Please change the start time to today's date and you will not see the issue. Because you have set the start time to start of year, it will run for each day and each hour so it keep on running for 24x166 times before coming to normal routine. Its still running on hourly basis but it has to complete the past runs for each hour, you will see that its running every few seconds. I am sure that your proc is just taking 1-2 seconds to complete.
There is another way to run 10 slices (10 is Maximum value) parallelly to increase the rate. If you want the past data also. Then this will be helpful.
Change the Concurrency value 3 under Policy to run the slices in parallel.
"policy": {
"concurrency": 3,
"executionPriorityOrder": "OldestFirst",
"retry": 3,
"timeout": "00:10:00"
}
Im running Stripe in test mode.
I've created a Yearly billing plan for 100GBP amount, with a 7 days trial ( directly onto Stripe dashboard. )
However, to test the webhooks i've hardcoded the trial_end:
$trialEnd = new DateTime();
$trialEnd->setTimestamp(time()+120);
$user = Users::find($this->user()['user_id']);
$user->subscription($stripe_plan['stripe_plan'])->trialFor($trialEnd)->create($data['stripeToken'], [
'email' => $this->user()['email']
]);
$user->save();
Basically all goes well, but into stripe dashboard the first invoice for 0 GBP is shown, and after one minute i get the Subscription will end in a minute event. After all, the subscription become Active ( from Trialing ) state.
All the webhooks and even the first subscription add reponse i get the trial ends period instead subscription ends.
How can i get the subscription_ends_at timestamp ?
All webhook requests are having the following timestamps:
{
"id": "evt_18baRrIzJLF7fe6PMDPYD0NM",
"object": "event",
"api_version": "2016-07-06",
"created": 1469558315,
"data": {
"object": {
"id": "sub_8tNBbqy0AmSk8p",
"object": "subscription",
"application_fee_percent": null,
"cancel_at_period_end": false,
"canceled_at": null,
"created": 1469558268,
"current_period_end": 1469558384,
"current_period_start": 1469558268,
"customer": "cus_8tNB1tWYw3Jw7L",
"discount": null,
"ended_at": null,
"livemode": false,
"metadata": {
},
"plan": {
"id": "yearly_200",
"object": "plan",
"amount": 20000,
"created": 1469545724,
"currency": "gbp",
"interval": "year",
"interval_count": 1,
"livemode": false,
"metadata": {
},
"name": "Full Club Membership - Pay Anually",
"statement_descriptor": "FULL MEMBERSHIP",
"trial_period_days": 7
},
"quantity": 1,
"start": 1469558268,
"status": "trialing",
"tax_percent": null,
"trial_end": 1469558384,
"trial_start": 1469558268
}
},
"livemode": false,
"pending_webhooks": 1,
"request": null,
"type": "customer.subscription.trial_will_end"
}
So if you look at trial_start and trial_end is same with current_period_start and current_period_end.
I've though initially that if this is the current period.. fine, but after trial expires the current period shouldn't be trials one.
There is any method to take the subscription_ends_at field from Stripe api ? And also, after the trial period ends, shouldn't send a invoice with the real amount ?
Also, i created a subscription plan with no trial period. That plan after a client subscribed, i get the correct timestamps.
Thanks in advance!
It looks like you figured it out. Basically, the delay comes from the fact that when the timestamp passes for your trial expiration, your request to create a new Invoice on that billing cycle gets added to a queue. Typically the queue will create the new invoice ~immediately, but it can sometimes go several minutes before triggering.
The first Invoice will always have timestamps for the current_period_* that map to the trial_period_* ones. Whereas, the second Invoice (that shows up with the invoice.created-event) will have the accurate timestamps for the billing period.
Oh, now i understand .. i will explain maybe will help someone :D.
Basically if a subscription got a trial period when you subscribe you will get a invoice for 0. Then, even if you set the trial to expire in 2 minutes with the request , the first payment will occur in about 10 minutes :D ( with that payment (if you set a webhook url) you will get a "type": "customer.subscription.updated" event who will contain all desired informations. At that time you can update your subscription_ends_at .
I didn't wait 10 minutes to see if the new invoice will be triggered.. and created -> removed -> recreated -> removed and so on for 4 hours with different tests.