question

PrasennaKannan-0682 avatar image
0 Votes"
PrasennaKannan-0682 asked MayankBargali-MSFT commented

amp; getting appended after & in APIM backend URL

Team,

https://**/apimtest/bigfile140.zip?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacupitfx&se=2022-05-20T06:38:41Z&st=2022-05-19T22:38:41Z&spr=https&sig=Cfpp7VAok%2FatmLEnpdMsOz8j5qxjUPdXU4lx%2Ffr5AJI%3D

I have the above Storage SAS URL configured in my Azure APIM backend URL in one of the PUT operation.

When I have a look into the inbound policy. I notice that after every & amp; is getting appended?

Why is that?

Thanks!

azure-blob-storageazure-api-management
· 5
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.

@PrasennaKannan-0682 Thank you for reaching out to Microsoft Q&A. I understand that you are having issues with your Storage SAS URL where after everry &, amp; is getting appended, is that right?

https://**/apimtest/bigfile140.zip?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacupitfx&se=2022-05-20T06:38:41Z&st=2022-05-19T22:38:41Z&spr=https&sig=Cfpp7VAok%2FatmLEnpdMsOz8j5qxjUPdXU4lx%2Ffr5AJI%3D

I do not see the amp; getting added here, can you provide more details such as snapshots etc., so I can understand better?

0 Votes 0 ·

@SaiKishor-MSFT :

204383-image.png




I have uploaded a screenshot which is taken from the APIM. I have highligted in yellow where amp; is getting appended after& in the inbound policy file definition.

0 Votes 0 ·
image.png (18.1 KiB)

@PrasennaKannan-0682 Thanks for sharing the details and screenshot. Can you confirm which policy (is it send-request) you are using along with the policy snippet so I can test it at my end.

0 Votes 0 ·
Show more comments

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT commented

@PrasennaKannan-0682 As per Rewrite URL document you cannot use query string.

purely structural URLs that do not contain a query string and instead contain only the path of the resource

You can leverage the named values for your requirement. I have defined the sas name value at my APIM instance and leverage the same in my rewrite policy.

Name/Value:
205901-image.png

Policy:
205856-image.png

ocp-apim-trace to confirm the value is set correctly:
205826-image.png

Let me know if it helps you to resolve the issue. Feel free to get back to me if you need any assistance.


image.png (15.9 KiB)
image.png (9.8 KiB)
image.png (13.6 KiB)
· 2
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.

@PrasennaKannan-0682 Thanks for your response. Glad to know that it helped. Feel free to get back to us in Microsoft Q&A if you need any assistance in future.

0 Votes 0 ·