Azure DevOps Incoming Webhook from Prismic not working - prismic.io

I'm attempting to connect a Prismic webhook to Azure DevOps so I can trigger a pipeline run when a CMS user publishes a document, for example. I am able to get the webhook up and running, and it seems to trigger pipeline when I manually click the "Trigger It" button in Settings/Webhooks. However, when I go to publish/unpublish the document, I receive a 200 response but nothing is triggered in DevOps.
I believe the root cause is that Prismic is sending a webhook trigger with JSON in the body that breaks something on the Microsoft side. I need help troubleshooting what DevOps is receiving and why it's not being processed.

Related

Azure Integration account AS2 sync MDN issue

I am performing a POC using Azure Integration account AS2. I have an issue with sending the sync MDN Message back.
I am using Mendelson to perform the testing
Sending a signed and encrypted message to Azure Logic App works
Decoding the message and validation works
Sending the sync MDN back is giving an error in Mendelson Issue
Message send back by Logic App
Found the issue:
Response Body should be:
"body": "#base64ToString(body('Decode_AS2_message')?['OutgoingMdn']?['Content'])"

Trigger for status update to send a patch method in Azure DevOps

Have been working on the integration between Azure DevOps Services and ServiceNow. Our goal is to send Change Requests from ServiceNow to Azure DevOps, where they would become Features or User Stories. Whenever there is some update on Azure DevOps, that update should be sent to ServiceNow, and vice versa.
The idea is to work with REST API.
From our investigation, we have found that it is possible to send updates to other applications through Web Hooks. We are still not sure if this will suite our needs and if we are able to work with this. The problem is that the webhooks only support the HTTP method POST while Service Now requests PATCH to update on it’s side. Is this correct is there any way of creating webhooks with PATCH method?
Other way that we can integrate is to create some software that will send response needed. However, we cannot seem to find a way to automate this response. As I understood, it will generate response only when the script run, not when work item is updated. Is there any way to trigger the sending of a json file with all information within the work item whenever the work item state is updated?
As a workaround, you can try to create a custom service hook. Here is the document you can refer to .
Marketplace provides an extension(Azure DevOps Service Hooks DSL) . This extension framework is designed to ease the development of your own REST Web Hook web site to do this type of integration. It does this by providing a MVC WebAPI endpoint and a collection of helper methods, implemented as an extensible Domain Specific Language (DSL), for common processing steps and API operations such as calling back to the TFS/VSTS server that called the endpoint or accessing SMTP services.
Is there any way to trigger the sending of a json file with all
information within the work item whenever the work item state is
updated?
I am not sure if it is possible to trigger that.
But there is a ServiceNow DevOps extension for the integration between Azure Devops and Snow. You may use that.

How to create a ServiceNow Change Request as a step in TFS 2018 Release

I am trying to create a ServiceNow Change Request as one of the steps in my Release. I was trying to Agentless Phase step (Invoke Rest API: Post).
I found one article online that suggested to create a Generic Endpoint for ServiceNow. I tried that in the step failed, I'm sure I don't have it set up correctly.
2019-11-12T12:55:28.8833838Z POST https://xyzhelpdesk.service-now.com/api/now/table/change_request
Response Code: 0
Response: An error was encountered while processing request.
Exception: {"error":{"message":"Exception while reading request","detail":"Cannot decode: java.io.StringReader#90f857"},"status":"failure"}
Exception Message: The remote server returned an error: (400) Bad Request. (type WebException)
The endpoint has a username and password defined, but I think in the setup for Step I may need more information in the Header section.
I can create the CR via a Powershell script, I guess I could just use that but Not sure the correct way to go.
Basically I want to create a ServiceNow CR as part of my deployment process. Then there is a TFS plugin gated step that will check the status on the CR and when it's approves the process moves forward.
Who has examples ?
Thanks
Actually there is a built-in extension-- ServiceNow Change Management which provide by Microsoft almost fit your needs.
It includes:
A release gate to hold the pipeline till the change management
process signals implementation for a change request. You can create a
new change request for every deployment or use an existing change
request.
An agentless task to update a change request during the deployment
process. It is typically used as the last task in the stage.
However, this extension works only with Azure DevOps Services and Azure DevOps Server 2019 Update 1 onwards.. Not available to use on tfs2018. You could consider to upgrade your TFS to latest Azure DevOps Version.
With TFS 2018, suggest you to use a powershell script to handle this. It's able to use
ServiceNow and Azure DevOps Rest API. You could also take a look at great article blogs(similar for TFS):
Integrating VSTS Release Management with ServiceNow using Deployment Gate for Change Management
Implement an Azure DevOps Release Gate to ServiceNow

Is it possible to send a message to a SQS Queue upon a HTML website button press?

I am trying to find a way to connect SQS with a website.
My general understanding of the project is that when a user clicks a button on the website it will send a message to the queue, and then I will have an Arduino receiving the message, which will then trigger a function that will move a robot. I have played around with Temboo and have managed to receive messages on the Arudino board, but I have no idea if it is even possible to send messages through a HTML button press. Is this even doable?
One way to send messages to SQS from a web browser is to use the AWS JavaScript SDK in the browser. You will need to supply credentials to the browser client so that it can make SDK calls, so ideally your client authenticates to your back-end and your back-end can send temporary (STS) credentials down to the client to use with the SDK.
Or you can use Amplify Pub/Sub, which is a higher-level framework than the AWS SDK.
Another way would be to create a small Lambda function, fronted with API Gateway, and then your browser client can POST to an HTTPS endpoint that will trigger your Lambda function to send the message to SQS.

Access data from an actual API service in protractor tests

I am writing end-to-end tests using Protractor for an Angular application. The application uses an API service to retrieve data from the back-end and this data is then used to populate pages in the Angular application.
I would like to utilize this API to get data to use in my jasmine tests, the tests will confirm that the back-end data is correctly and completely populated on applicable pages in the UI. I definitely DO NOT want to mock the server, I want to hit the actual server and work with the actual data from the JSON response.
My question is 2 sided; how to call the API service from my protractor tests and secondly, how to retrieve data from the JSON response from this API.
Any (detailed) information, examples you can provide as to how this can be done would be appreciated
Thanks in advance.
Protractor is used to test the ui of an application. What it does is click buttons and enter text in text boxes and wait for responses. For example if I have a login form and want to test the scenario when a user enters an email address wrong and an error message pops up. Protractor would navigate to the email field, enter an incorrect email address and then find the element that contains the error and verify the error showed up.
So as long as you have an environment setup that has a ui connected to an API service, the API service will be called as normal. Protractor will click buttons and if a button click triggers a call to the API service it will go straight to that service.
As for the JSON response access, this is probably not a good use for protractor. Protractor is used to click events and wait for responses. So if you are displaying that JSON response in some form or way protractor could verify it is displayed. For example, if you are displaying some data from the server in a table on a button click, you could have protractor click that button and verify the table has the correct values. But you would not want to verify the JSON object is as expected. That would be unit-tests on the API itself.
Hope this helps.
We have two options
Make a request by require(...) and using a request library.
This allows you to make direct HTTP Service calls, as discussed in this Stack Overflow post
Use some data from a .json file by require(...) it directly:
https://github.com/angular/protractor/issues/978#issuecomment-47250364