question

MadalaHanumantharao-5095 avatar image
0 Votes"
MadalaHanumantharao-5095 asked MayankBargali-MSFT edited

How to resolve 403/500 errors during APIM to APIM communication (hosted in separate virtual networks)

Scenario:
I have two APIM instances deployed in my environment.
1) hosted in internet segment within first virtual network
2) hosted in intranet segment within second virtual network
3) peering is enabled between vnets.

Note: I do not have any issue while testing my api hosted in intranet, which in turn call the backend services (azure app service - webapp)

forward-request (152.089 ms)
{
"response": {
"status": {
"code": 403,
"reason": "Forbidden"
},
"headers": [
{
"name": "Vary",
"value": "Origin"
},
{
"name": "Access-Control-Allow-Origin",
"value": "https://apimanagement.hosting.portal.azure.net"
},
{
"name": "Access-Control-Allow-Credentials",
"value": "true"
},
{
"name": "Access-Control-Expose-Headers",
"value": "Content-Length,Vary"
},
{
"name": "Content-Length",
"value": "45"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "Date",
"value": "Thu, 15 Jul 2021 01:52:44 GMT"
}
]
}
}
Outbound
(1.214 ms)↑ Back to top
cors (0.062 ms)
{
"message": "Headers starting with 'Access-Control-' were removed from the response. ",
"headers": [
{
"name": "Vary",
"value": "Origin,Origin"
},
{
"name": "Access-Control-Allow-Credentials",
"value": "true"
},
{
"name": "Access-Control-Expose-Headers",
"value": "Vary,Content-Length,Date,Ocp-Apim-Trace-Location"
}
]
}
transfer-response (1.152 ms)
{
"message": "Response has been sent to the caller in full"
}

azure-api-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MadalaHanumantharao-5095 avatar image
0 Votes"
MadalaHanumantharao-5095 answered MayankBargali-MSFT edited

I would need the sample front-end apim api's code to call backend apim api service, which will call target backend service (azure app service)

How to fix the below error? Appreciate some guidance here. thanks.

set-body (0.406 ms)
{
"messages": [
{
"message": "Expression evaluation failed.",
"expression": "\n var response = context.Response.Body.As<JObject>();\n \n return response.ToString();\n ",
"details": "Object reference not set to an instance of an object."
},
"Expression evaluation failed. Object reference not set to an instance of an object.",
"Object reference not set to an instance of an object."
]
}

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MadalaHanumantharao-5095 Apology for the delay. Can you confirm if you are still facing the issue? This need dedicated troubleshooting and review your policy as per the error message there is issue with your policy expression evaluation. I will suggest you to open a support ticket with us to assist you further. If you don't have support plan please let me know.

0 Votes 0 ·

@Mayank, Yes we do not have support plan.
For time being, I have kept this task on hold.
Thank you for your kind support and follow-up on this issue.

0 Votes 0 ·

@MadalaHanumantharao-5095 Thanks for your response. Please tag me in once you resume/ need any assistance and I would assist you further.

0 Votes 0 ·