Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion templates/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"poweroff-vm-new.json",
"deallocate-vm-new.json",
"cosmos-send-query-result.json",
"delete-old-blob.json"
"delete-old-blob.json",
"notify-when-blob-added-updated.json"
]
103 changes: 103 additions & 0 deletions templates/notify-when-blob-added-updated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"id": "Notify_when_a_blob_is_added_or_updated",
"title": "Notify when a change is made in container",
"description": "Sends an email when a blob is added or updated to container",
"iconType": "Event",
"data": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Send_an_email_(V2)": {
"inputs": {
"body": {
"Body": "<p>Here are the list of files that were added or updated:<br>\n@{triggerBody()?['Path']}</p>",
"Subject": "New content added @{triggerBody()?['DisplayName']}",
"To": "@parameters('emailTo')"
},
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"path": "/v2/Mail"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
},
"BlobContainer": {
"type": "String",
"defaultValue": "/container",
"metadata": {
"displayName": "Container name",
"required": true,
"description": "Container in whcih blobs are residing"
}
},
"emailTo": {
"type": "String",
"metadata": {
"displayName": "Notify me on",
"defaultValue": "user@contoso.com",
"required": true,
"description": "Enter email id to be notified on"
}
}
},
"triggers": {
"When_a_blob_is_added_or_modified_(properties_only)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob_1']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/triggers/batch/onupdatedfile",
"queries": {
"checkBothCreatedAndModifiedDateTime": false,
"folderId": "@parameters('BlobContainer')",
"maxFileCount": 10
}
},
"metadata": {
"JTJmY29udGFpbmVy": "/container"
},
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"splitOn": "@triggerBody()",
"type": "ApiConnection"
}
}
},
"parameters": {
"$connections": {
"value": {
"azureblob_1": {
"connectionId": "",
"connectionName": "",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westus/managedApis/azureblob"
},
"office365": {
"connectionId": "",
"connectionName": "",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/westus/managedApis/office365"
}
}
}
}
},
"supportedResources": [
"Microsoft.Storage/storageAccounts"
]
}