I am working on a project that requires SAP Solution Manager (SOLMAN) to be integrated with Azure Devops Rest API.
Functionality:
- Whenever a Work Package is created in SOLMAN, I want to take the generated JSON and create a Feature in Azure Devops.
- Once the Feature is created in Azure Devops, I want to return back id of the Feature as EXTERNAL_ID to SOLMAN.
I have created an API and Deployed it to PCF. When I am hitting the api endpoint, the work item gets created in Azure devops.
But when I create an RFC giving the details about target host and url, I am getting an error like this(in SAP thingy, ABAP debugger or something):
A potentially dangerous Request.Path value was detected from the client (:).","typeName":"System.Web.HttpException
In PCF logs, I am able to see this error(in PCF logs):
Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware Failed to determine the https port for redirect.
It looks like I am doing something wrong. My Rest API does not have an Auth Mechanism - I think this could be the missing link. Or May be I have to use a specific port for HTTPS. I am stuck here.
Can any one help me or share experience about this?
I managed to finally integrate SAP Solution Manager with Azure Devops. Since I have got the solution and the integration is working, I am writing this answer.
When I look back to the question which I am answering now, it looks like I did not properly explain my scenario and I asked a technical question. I will properly explain what I was trying to do in the later part of this answer,but for that particular problem:
Problem: I was trying to call SOLMAN External API from my .NET CORE 3.1 Web API, upon calling the SOLMAN api I was getting the aforementioned error.
Cause : SOLMAN API expects any external tool or service(api) to :
Solution:
The solution of this problem has two parts -
1. Adding Username and Password in authentication header with the request.
Ideally you will have some kind of authentication scheme for your API. If not, then you would need one. You will have to add Authorization field in header with the user name and password. This way, you will not get any authentication error like 401 or 403.
2. Check if your API is communicating over HTTPS.
I wrote my API in .NET Core 3.1 and in .NET Core we can use HTTPSRedirection Middleware to ensure the API communicates over HTTPS. If any HTTP request comes, it redirects to HTTPS. This way you get the HTTPS communication going.
In my case I deployed my API to cloud server, which was already providing HTTPS by default and I also added the HTTPSRedirection Middleware in my API. But I started getting the error :
So I removed the middleware and it started working.
Now, that I have got that out of the way, I can explain more about what I was trying to do. I wanted to sync Work Items/ Work Packages created in SAP Solution Manager with Azure Devops backlog/board. Following were the requirements:
For this requirement, I created a Web API which works in the middle of these two tools (Azure Devops and Sap Solution Manager) and establish a connection between these two. This API does following tasks :
So, this API acts as a connector for these two tools. One of the comment on the question by @Jeff pointed out for a Commercial Off the shelf product as well, which could be a good alternative for this problem if you have it. But I do not know how that works since for me procuring a new Software for this wasn't possible.