2
votes

I'm using Azure Data Lake Storage to store a large amount of files. I'm setting up an Azure API Management gateway in front of it, which rewrites the URI and sets the backend service to the ADLS REST API (Gen2).

At this point I'm trying to configure the Path - Read pass-through. My operation in APIM is /data/{filesystem}/{path}?timeout={timeout}, which I would like to be able to call as follows:

(timeout is optional)

filesystem: MyFileSystem
path:       Path/To/File.json
GET https://example.com/api/data/MyFileSystem/Path/To/File.json

However, when I navigate to this operation in the Azure Portal and use the Test feature, it reports the following error:

{ "message": "Unable to identify Api or Operation for this request. Responding to the caller with 404 Resource Not Found." }

I understand that APIM is likely looking for an operation matching /MyFileSystem/Path/To/File.json and cannot find one.

For what it's worth, my Path - List endpoint works as I'd expect, which is why I know it's specifically the {path} that's holding me up.

GET https://example.com/api/data/MyFileSystem?recursive=true&resource=filesystem

200 OK

I imagine I can change from a template parameter to a query parameter, but I'd prefer to avoid that route for now. So, is there a way to have a template parameter that allows slashes?

2

2 Answers

5
votes

Yes. Last template parameter may have slashes. Use {*path}.

1
votes

You are right Santi, slashes in template param will make APIM unable to find corresponding operation to handle requests.What's more, it is useless that you URL-encode the slashes as APIM will URL-encode your param again if it includes special characters which will mass the path. I tested your scenario on Azure storage, if your use "\" to replace "/" it works well , you can have a try on it :

enter image description here

enter image description here