I have an Azure logic app that uses a "Send HTTP request" block to send a REST API call to VSTS to create an incident. The call fails with "HTTP Error 400. The request hostname is invalid.".
I tried the same request from Postman and the request succeeded. To make sure that I am making the same request I copied the URI, the headers, the body from the logic app.
How can I further investigate what is going on? Is there a log in VSTS where I can find out more info. Any help, any suggestion is highly appreciated.
Here you have the code of the "HTTP request block"
{
"inputs": {
"method": "POST",
"uri": "https://dev.azure.com/<your-vsts-organization>/<your-vsts-project>/_apis/wit/workitems/$Incident?api-version=4.1",
"headers": {
"Authorization": "Basic .................................",
"Content-Type": "application/json-patch+json"
},
"body": "[
{
"op": "add",
"path": "/fields/System.Description",
"from": null,
"value": "@{body('Parse_JSON_2')['Description']}"
},
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "@{body('Parse_JSON_2')['Title']}"
},
{
"op": "add",
"path": "/fields/System.IterationPath",
"from": null,
"value": "<your-iteration-path>"
},
{
"op": "add",
"path": "/fields/System.AreaPath",
"from": null,
"value": "<your-area-path>"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.Common.Priority",
"from": null,
"value": "2"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.Common.Severity",
"from": null,
"value": "2 - High"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.CMMI.HowFound",
"from": null,
"value": "Azure Monitoring Alert"
},
]"
}
}
Here you have a screenshot of the request block:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…