asp.net-web-apiazure-api-managementasp.net-web-api-odata

How to change the service root in webapi odata v3?


Have webapi odata v3 endpoint implemented with Microsoft.AspNet.WebApi.OData, exposed under API management, how do I change the service root path, instead of returning the azurewebsite one return the api management URL.


Solution

  • Try using the <redirect-content-urls/> policy in an outbound policy to update the URLs. If that doesn't work as you need, you can use the <find-and-replace/> policy. https://learn.microsoft.com/en-us/azure/api-management/api-management-transformation-policies#MaskURLSContent