ADF until block skipped property to send mail Email notification - azure

If until activity skipped after 5 mins. I need to send a mail.
How to send the message from until to email notification pipeline.
Email notification have message as a parameter. What is the correct Syntax if pipeline skipped
<p>Hi All,<\/p>\r\n<p>Below pipeline got failed please find the error details.<\/p><br \/>\r\n<p>Pipeline Name : #{pipeline().Pipeline}<\/p>\r\n<p>Error Detail : <br\/>#{activity('LKP_INF_JOB_STATUS').output.error.message}<\/p>\r\n<p> <\/p>\r\n<p>Thanks,<br\/>SPC Support Team<\/p>\r\n<p> <\/p>\r\n<p><br \/>Note:This is an auto-generated email from XYZ, please do not reply directly to this email.<\/p>
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/yUtUQ.png

I implemented a simple solution for this:
1. Give your Until Activity a specific timeout
2. Create a Web Activity that uses the ADF API to query the Until Activity using a Completion dependency (blue arrow)
Refer to this Stack Overflow for details on how to use this API in ADF:
How to get output parameter from Executed Pipeline in ADF?
URL: https://management.azure.com/subscriptions/#{pipeline().parameters.SubscriptionId}/resourceGroups/#{pipeline().parameters.ResourceGroupName}/providers/Microsoft.DataFactory/factories/#{pipeline().DataFactory}/pipelineruns/#{pipeline().RunId}/queryActivityruns?api-version=2018-06-01
Body:
{
"lastUpdatedAfter": "2018-06-16T00:36:44.3345758Z",
"lastUpdatedBefore": "#{utcnow()}",
"filters": [
{
"operand": "ActivityName",
"operator": "Equals",
"values": [
"Until Timeout after 1 min"
]
}
]
}
3. Use output from activity in Switch to determine which Email Activity to use (Failure, or TimeOut)
Expression:
#activity('Check Until Activity Status').output.value[0].status
4. Email Activity
{
"personalizations": [
{
"to": [
{
"email": "YourEmail#blah.com",
"name": "blah"
}
],
"cc": [
{
"email": "jane_doe#example.com",
"name": "Jane Doe"
}
],
"bcc": [
{
"email": "james_doe#example.com",
"name": "Jim Doe"
}
]
}
],
"from": {
"email": "blah#example.com",
"name": "Blah"
},
"subject": "SkipEmail",
"content": [
{
"type": "text/html",
"value": "This is a Skip Example, put whatever here"
}
]
}

Related

Slack API triggering action event for element in input block

My Slack app sends a radio-button question to the users. The app is built using bolt-js. The radio buttons are inside an input block (ref: Slack Block Kit).
According to bolt-js reference for the method app.action:
... Note that action elements included in an input block do not trigger any events.
However, I still receive events on the app.action listener from elements that are inside the input block.
The code for sending the message is this:
await client.chat.postMessage({
"channel": channelId,
"blocks": [
{
"type": "input",
"label": {
"type": "plain_text",
"text": "Some question"
},
"element": {
"type": "radio_buttons",
"options": [
{
"text": {
"type": "plain_text",
"text": "Option A",
},
"value": "value-0"
},
{
"text": {
"type": "plain_text",
"text": "Option B",
},
"value": "value-1"
},
],
"action_id": "some_action",
}
}
],
"text": "Some Text"
});
I have tried:
Removing the app.action('some_action') listener for this particular action. With this, the app logs show the following error:
[ERROR] An incoming event was not acknowledged within 3 seconds. Ensure that the ack() argument is called in a listener.
Removing the "action_id": "some_action" line from the block json. I still get the above mentioned error in the logs.
Explicitly setting "dispatch_action": false in the block json (which is false by default according to the input block reference). The event is still triggered.
I do not want the event to be triggered. What am I doing wrong?

Create Azure DevOps task with description

I'd like to open a Bug using the Azure DevOps REST API and create it with a description. I couldn't find in the docs how to do it, I've only seen something about the title.
I've been trying to create a bug with a description by sending this body on the request:
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
},
{
"op": "add",
"path": "/fields/System.Description",
"from": null,
"value": "Test of REST functionality"
}
]
But still no success...
The work item type Bug does not have the field Description. Instead, it has the field called Steps to Reproduce, which is probably what you're trying to set.
So, first of all you need to specify the type URI parameter to be a Bug, and change the payload to something like the following:
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.TCM.ReproSteps",
"from": null,
"value": "Test of REST functionality"
}
]
I can't verify this to be 100% sure at the moment but hope this gives you enough information to try it out.

Fiware Actuator/Sensor On Off pattern with status

My configuration includes orion, IoT Agent JSON, and mongoDB.
I want to build a Fiware Lamp actuator and I want to have is on/off status (as sensor) as well.
At the moment I use a PATCH request with body (form ORION) :
At First with on command:
{
"on": {
"type" : "command",
"value" : ""
}
}
And then with off command:
{
"off": {
"type" : "command",
"value" : ""
}
}
When I receive anything from the above, I respond from the dummy device with 200 OK.
The above in my configuration makes both the on and off tags as pending:
{
"id": "urn:ngsi-ld:Lamp:001",
"type": "Lamp",
"TimeInstant": "2020-11-04T22:42:37.00Z",
"category": [
"actuator",
"sensor"
],
"controlledProperty": "lamp",
"function": [
"onOff",
"sensing"
],
"off_info": " ",
"off_status": "PENDING",
"on_info": " ",
"on_status": "PENDING",
"refStore": "urn:ngsi-ld:Store:001",
"state": " ",
"supportedProtocol": [
"JSON"
],
"supportedUnits": "My Unit 2",
"on": "",
"off": ""
}
I guess that I miss something in the way, so is there any response that I have to sent back to IoT Agent json to to make one of the two tags to stop be pending? Must I Update State or Info along the way?
P.S I expected to have a reply like this:
{
"id": "urn:ngsi-ld:Lamp:001",
"type": "Lamp",
"TimeInstant": "2020-11-04T22:42:37.00Z",
"category": [
"actuator",
"sensor"
],
"controlledProperty": "lamp",
"function": [
"onOff",
"sensing"
],
"off_info": " ",
"off_status": "PENDING",
"on_info": " ",
"on_status": "OFF",
"refStore": "urn:ngsi-ld:Store:001",
"state": " ",
"supportedProtocol": [
"JSON"
],
"supportedUnits": "My Unit 2",
"on": "",
"off": ""
}
The flow of a command can be seen below:
Assuming your command has reached the lamp and it has turned on, the result needs to be passed back into the IoT Agent. For the JSON IoT Agent, the payload looks something like this:
{"on" : "OK"}
Where the key is the name of the command, and the value is the status. My guess is that your device is just responding 200 OK without a payload, so the IoT Agent doesn't know which command has fired.
Note that in the case of a distributed network (e.g. MQTT or AMPQ) the response will be posted asynchronously on another topic so the command may be left in a PENDING state for some time.

Logic App posting to Microsoft Teams data not showing in fields

I've created an Alert in my App Service that sends an Alert to a logic app, the logic app is then posting a message to Microsoft Teams.
https://learn.microsoft.com/en-us/azure/azure-monitor/platform/action-groups-logic-app
Everything is working as expected accept that i can get the data out of the individual into my Message.
I've used the following in schema in my logic App
{
"schemaId": "azureMonitorCommonAlertSchema",
"data": {
"essentials": {
"alertId": "/subscriptions/MyAlert",
"alertRule": "Web - Test teams",
"severity": "Sev1",
"signalType": "Metric",
"monitorCondition": "Fired",
"monitoringService": "Platform",
"alertTargetIDs": [
"/subscriptions/MySub"
],
"originAlertId": "bd40051b-35fa-,
"firedDateTime": "2020-06-03T14:53:34.0942607Z",
"description": "",
"essentialsVersion": "1.0",
"alertContextVersion": "1.0"
},
"alertContext": {
"properties": null,
"conditionType": "SingleResourceMultipleMetricCriteria",
"condition": {
"windowSize": "PT5M",
"allOf": [
{
"metricName": "Http2xx",
"metricNamespace": "Microsoft.Web/sites",
"operator": "GreaterThan",
"threshold": "5",
"timeAggregation": "Total",
"dimensions": [
{
"name": "ResourceId",
"value": "MyWebs.com"
}
],
"metricValue": 24,
"webTestName": null
}
],
"windowStartTime": "2020-06-03T14:45:23.095Z",
"windowEndTime": "2020-06-03T14:50:23.095Z"
}
}
}
}
Then in the designer added the fields
Here is the details from the Logic code view for the message body
"content": "Your Azure Monitor alert was triggered\nAzure monitor alert rule Web - Test teams was triggered at #{triggerBody()?['body']?['data']?['alertContext']?['condition']?['windowEndTime']}\n\nRule: #{triggerBody()?['body']?['data']?['essentials']?['alertRule']}\nBody:#{triggerBody()}\nHeader:#{triggerOutputs()['headers']}\nheaders:#{triggerBody()?['headers']}\nessentials:#{triggerBody()?['body']?['data']?['essentials']}\ndata:#{triggerBody()?['body']?['data']}\nbody:#{triggerBody()?['body']}"
The only field that gets populated is the body and none of the specific fields
Your Azure Monitor alert was triggered
Azure monitor alert rule Web - Test teams was triggered at
Rule:
Body:{"schemaId":"azureMonitorCommonAlertSchema","data":{"essentials":{"alertId":"/subscriptions/bresourceGroups/Microsoft.AlertsManagement/alerts","alertRule":"Web - Test Alert","severity":"Sev0","signalType":"Metric","monitorCondition":"Fired","monitoringService":"Platform","alertTargetIDs":[""],"originAlertId":"":"2020-06-03T15:49:20.1712118Z","description":"","essentialsVersion":"1.0","alertContextVersion":"1.0"},"alertContext":{"properties":null,"conditionType":"SingleResourceMultipleMetricCriteria","condition":{"windowSize":"PT5M","allOf":[{"metricName":"Http2xx","metricNamespace":"Microsoft.Web/sites","operator":"GreaterThan","threshold":"3","timeAggregation":"Count","dimensions":[{"name":"ResourceId","value":""}],"metricValue":7.0,"webTestName":null}],"windowStartTime":"2020-06-03T15:41:05.994Z","windowEndTime":"2020-06-03T15:46:05.994Z"}}}}
Header:{"Connection":"Keep-Alive","Expect":"100-continue","Host":"prod-06.uksouth.logic.azure.com","User-Agent":"IcMBroadcaster/1.0","X-CorrelationContext":"RkkKACgAAAACAAAAEABEgMLahbH0Sqw1EVoRy7Y8AQAQANlpmHhZlSRMkU6bLTb+DSk=","Content-Length":"1254","Content-Type":"application/json; charset=utf-8"}
headers:
essentials:
data:
body:
I had to manually update the Logic Code and remove the additional body tag
original
#{triggerBody()?['body']?['data']?['alertContext']?['condition']?['windowEndTime']}
to this
#{triggerBody()?['data']?['alertContext']?['condition']?['windowEndTime']}

Is it possible to change verbiage of listAuditEvents?

The current [Envelopes: listAuditEvents] creates the following verbiage for correction:
"eventFields": [
{
"name": "logTime",
"value": "2018-09-18T19:09:01.3603686Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Staging"
},
{
"name": "UserId",
"value": "8c57af14-e46a-4965-ae8b-42bb0c29b706"
},
{
"name": "Action",
"value": "Correction Initiated"
},
{
"name": "Message",
"value": "Staging initiated correction"
},
{
"name": "EnvelopeStatus",
"value": "correct"
},
I would like to modify the Message values. I have gone through Docusigns API but I have not found any indication that this is possible.
Has anyone had the same need? and if so were you able to add custom message verbiage for certain events/actions?
Thanks.
It's not possible for you to configure the contents of the API response for the listAuditEvents operation. However, you could (in your code) include logic to parse the API response and based on certain values in the response, substitute values (for purposes in your app) with the verbiage you prefer.
For example, let's say that you have a page in your app that displays the various events that have occurred for an Envelope, but you don't want to display the verbiage "[UserName] initiated correction" as the text in your UI when a user initiates an envelope correction -- instead you want to display the text "[UserName] changed envelope settings." The logic in your code could do something like this psuedo code shows (where auditEvent represents an object within the API response body for the listAuditEvents operation):
if (auditEvent.ActionInitiated == "Correction Initiated") {
displayMessageInUI(auditEvent.UserName + " changed envelope settings.");
}

Resources