-
Notifications
You must be signed in to change notification settings - Fork 30
Added template for executing query on recurrence #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shahparth-lab
wants to merge
4
commits into
master
Choose a base branch
from
parth/templates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,303 @@ | ||
| { | ||
| "id": "Send_query_result_via_e-mail", | ||
| "title": "Send query result via e-mail", | ||
| "description": "Execute a query and send email on schedule", | ||
| "iconType": "ScheduledTask", | ||
| "data": { | ||
| "definition": { | ||
| "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | ||
| "actions": { | ||
| "ExecuteQuery": { | ||
| "inputs": { | ||
| "body": { | ||
| "query": "@parameters('queryString')" | ||
| }, | ||
| "host": { | ||
| "connection": { | ||
| "name": "@parameters('$connections')['sql']['connectionId']" | ||
| } | ||
| }, | ||
| "method": "post", | ||
| "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent(parameters('ServerID')))},@{encodeURIComponent(encodeURIComponent(parameters('DatabaseID')))}/query/sql" | ||
| }, | ||
| "runAfter": {}, | ||
| "type": "ApiConnection" | ||
| }, | ||
| "Send_an_email_(V2)": { | ||
| "inputs": { | ||
| "body": { | ||
| "Body": "<p>@{body('ExecuteQuery')?['resultsets']}<br>\n<br>\n<br>\n<br>\n<br>\n<br>\n</p>", | ||
| "Subject": "Query results from @{parameters('DatabaseID')}", | ||
| "To": "@parameters('Email To')" | ||
| }, | ||
| "host": { | ||
| "connection": { | ||
| "name": "@parameters('$connections')['office365']['connectionId']" | ||
| } | ||
| }, | ||
| "method": "post", | ||
| "path": "/v2/Mail" | ||
| }, | ||
| "runAfter": { | ||
| "ExecuteQuery": [ | ||
| "Succeeded" | ||
| ] | ||
| }, | ||
| "type": "ApiConnection" | ||
| } | ||
| }, | ||
| "contentVersion": "1.0.0.0", | ||
| "outputs": {}, | ||
| "parameters": { | ||
| "$connections": { | ||
| "defaultValue": {}, | ||
| "type": "Object" | ||
| }, | ||
| "DatabaseID": { | ||
| "type": "String" | ||
| }, | ||
| "Email To": { | ||
| "type": "String", | ||
| "defaultValue": "email@example.com", | ||
| "metadata": { | ||
| "displayName": "Email To", | ||
| "required": false, | ||
| "description": "Send the query results to this email" | ||
| } | ||
| }, | ||
| "Frequency": { | ||
| "type": "String", | ||
| "allowedValues": [ | ||
| "Month", | ||
| "Week", | ||
| "Day", | ||
| "Hour", | ||
| "Minute", | ||
| "Seconds" | ||
| ], | ||
| "metadata": { | ||
| "displayName": "Frequency", | ||
| "required": true, | ||
| "description": "How often should schedule run. i.e. Weekly" | ||
| } | ||
| }, | ||
| "Interval": { | ||
| "type": "Int", | ||
| "metadata": { | ||
| "displayName": "Interval", | ||
| "format": "number", | ||
| "required": true, | ||
| "description": "Time interval for recurrence" | ||
| } | ||
| }, | ||
| "ResourceGroup": { | ||
| "type": "String", | ||
| "metadata": { | ||
| "isLinkedResource": true, | ||
| "sourceParameter": "resourceGroup" | ||
| } | ||
| }, | ||
| "ScheduleTime": { | ||
| "type": "String", | ||
| "defaultValue": "start time", | ||
| "metadata": { | ||
| "displayName": "Time", | ||
| "format": "timeFormat", | ||
| "required": false, | ||
| "description": "Runs the query at this time" | ||
| } | ||
| }, | ||
| "ServerID": { | ||
| "type": "String" | ||
| }, | ||
| "SubscriptionID": { | ||
| "type": "String", | ||
| "metadata": { | ||
| "isLinkedResource": true, | ||
| "sourceParameter": "subscriptionId" | ||
| } | ||
| }, | ||
| "Timezone": { | ||
| "type": "String", | ||
| "allowedValues": [ | ||
| "Dateline Standard Time", | ||
| "UTC-11", | ||
| "Aleutian Standard Time", | ||
| "Hawaiian Standard Time", | ||
| "Marquesas Standard Time", | ||
| "Alaskan Standard Time", | ||
| "UTC-09", | ||
| "Pacific Standard Time (Mexico)", | ||
| "UTC-08", | ||
| "Pacific Standard Time", | ||
| "US Mountain Standard Time", | ||
| "Mountain Standard Time (Mexico)", | ||
| "Mountain Standard Time", | ||
| "Central America Standard Time", | ||
| "Central Standard Time", | ||
| "Easter Island Standard Time", | ||
| "Central Standard Time (Mexico)", | ||
| "Canada Central Standard Time", | ||
| "SA Pacific Standard Time", | ||
| "Eastern Standard Time (Mexico)", | ||
| "Eastern Standard Time", | ||
| "Haiti Standard Time", | ||
| "Cuba Standard Time", | ||
| "US Eastern Standard Time", | ||
| "Paraguay Standard Time", | ||
| "Atlantic Standard Time", | ||
| "Venezuela Standard Time", | ||
| "Central Brazilian Standard Time", | ||
| "SA Western Standard Time", | ||
| "Pacific SA Standard Time", | ||
| "Turks And Caicos Standard Time", | ||
| "Newfoundland Standard Time", | ||
| "Tocantins Standard Time", | ||
| "E. South America Standard Time", | ||
| "SA Eastern Standard Time", | ||
| "Argentina Standard Time", | ||
| "Greenland Standard Time", | ||
| "Montevideo Standard Time", | ||
| "Saint Pierre Standard Time", | ||
| "Bahia Standard Time", | ||
| "UTC-02", | ||
| "Mid-Atlantic Standard Time", | ||
| "Azores Standard Time", | ||
| "Cape Verde Standard Time", | ||
| "UTC", | ||
| "Morocco Standard Time", | ||
| "GMT Standard Time", | ||
| "Greenwich Standard Time", | ||
| "W. Europe Standard Time", | ||
| "Central Europe Standard Time", | ||
| "Romance Standard Time", | ||
| "Central European Standard Time", | ||
| "W. Central Africa Standard Time", | ||
| "Namibia Standard Time", | ||
| "Jordan Standard Time", | ||
| "GTB Standard Time", | ||
| "Middle East Standard Time", | ||
| "Egypt Standard Time", | ||
| "E. Europe Standard Time", | ||
| "Syria Standard Time", | ||
| "West Bank Standard Time", | ||
| "South Africa Standard Time", | ||
| "FLE Standard Time", | ||
| "Turkey Standard Time", | ||
| "Israel Standard Time", | ||
| "Kaliningrad Standard Time", | ||
| "Libya Standard Time", | ||
| "Arabic Standard Time", | ||
| "Arab Standard Time", | ||
| "Belarus Standard Time", | ||
| "Russian Standard Time", | ||
| "E. Africa Standard Time", | ||
| "Iran Standard Time", | ||
| "Arabian Standard Time", | ||
| "Astrakhan Standard Time", | ||
| "Azerbaijan Standard Time", | ||
| "Russia Time Zone 3", | ||
| "Mauritius Standard Time", | ||
| "Georgian Standard Time", | ||
| "Caucasus Standard Time", | ||
| "Afghanistan Standard Time", | ||
| "West Asia Standard Time", | ||
| "Ekaterinburg Standard Time", | ||
| "Pakistan Standard Time", | ||
| "India Standard Time", | ||
| "Sri Lanka Standard Time", | ||
| "Nepal Standard Time", | ||
| "Central Asia Standard Time", | ||
| "Bangladesh Standard Time", | ||
| "N. Central Asia Standard Time", | ||
| "Myanmar Standard Time", | ||
| "SE Asia Standard Time", | ||
| "Altai Standard Time", | ||
| "W. Mongolia Standard Time", | ||
| "North Asia Standard Time", | ||
| "Tomsk Standard Time", | ||
| "China Standard Time", | ||
| "North Asia East Standard Time", | ||
| "Singapore Standard Time", | ||
| "W. Australia Standard Time", | ||
| "Taipei Standard Time", | ||
| "Ulaanbaatar Standard Time", | ||
| "North Korea Standard Time", | ||
| "Aus Central W. Standard Time", | ||
| "Transbaikal Standard Time", | ||
| "Tokyo Standard Time", | ||
| "Korea Standard Time", | ||
| "Yakutsk Standard Time", | ||
| "Cen. Australia Standard Time", | ||
| "AUS Central Standard Time", | ||
| "E. Australia Standard Time", | ||
| "AUS Eastern Standard Time", | ||
| "West Pacific Standard Time", | ||
| "Tasmania Standard Time", | ||
| "Vladivostok Standard Time", | ||
| "Lord Howe Standard Time", | ||
| "Bougainville Standard Time", | ||
| "Russia Time Zone 10", | ||
| "Magadan Standard Time", | ||
| "Norfolk Standard Time", | ||
| "Sakhalin Standard Time", | ||
| "Central Pacific Standard Time", | ||
| "Russia Time Zone 11", | ||
| "New Zealand Standard Time", | ||
| "UTC+12", | ||
| "Fiji Standard Time", | ||
| "Kamchatka Standard Time", | ||
| "Chatham Islands Standard Time", | ||
| "Tonga Standard Time", | ||
| "Samoa Standard Time", | ||
| "Line Islands Standard Time" | ||
| ], | ||
| "metadata": { | ||
| "displayName": "Timezone", | ||
| "required": true, | ||
| "description": "Select time zone for task schedule" | ||
| } | ||
| }, | ||
| "queryString": { | ||
| "type": "String", | ||
| "defaultValue": "SELECT * FROM table", | ||
| "metadata": { | ||
| "displayName": "Query Text", | ||
| "required": false, | ||
| "description": "Query to be executed" | ||
| } | ||
| } | ||
| }, | ||
| "triggers": { | ||
| "Recurrence": { | ||
| "recurrence": { | ||
| "frequency": "@parameters('Frequency')", | ||
| "interval": "@parameters('Interval')", | ||
| "startTime": "@formatDateTime(parameters('ScheduleTime'), 'yyyy-MM-ddTHH:mm:ss')", | ||
| "timeZone": "@parameters('TimeZone')" | ||
| }, | ||
| "type": "Recurrence" | ||
| } | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "$connections": { | ||
| "value": { | ||
| "office365": { | ||
| "connectionId": "", | ||
| "connectionName": "", | ||
| "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westus/managedApis/office365" | ||
| }, | ||
| "sql": { | ||
| "connectionId": "", | ||
| "connectionName": "", | ||
| "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westus/managedApis/sql" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "supportedResources": [ | ||
| "Microsoft.Sql/servers/databases" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need to update the
manifest.jsonfile to include this template.