Blob SAS URI character decoded when passed as Query parameter to Azure Function app

Ashish 96 Reputation points
2021-05-06T11:47:27.377+00:00

I wanted to pass the SAS URI of a image file to Azure Functions as query parameters.
But when I pass the below URL, some characters from 'sig' part get decoded

https://ABCD.blob.core.windows.net/images/test.jpg?sp=r&st=2021-05-06T11:30:21Z&se=2022-05-06T19:30:21Z&spr=https&sv=2020-02-10&sr=b&sig=JuPyAR%2F5WNeSVXj4G%2Fft9QDMzL%2BtXSywSS375jZpjXQ%3D

The above URL becomes
https://ABCD.blob.core.windows.net/images/test.jpg?sp=r&st=2021-05-06T11:30:21Z&se=2022-05-06T19:30:21Z&spr=https&sv=2020-02-10&sr=b&sig=JuPyAR/5WNeSVXj4G/ft9QDMzL+tXSywSS375jZpjXQ=

%2F to /
%2B to +
%3D to =

Because of this when I try to access the blob, I get error:
System.Private.CoreLib: Exception while executing function: <FUNCTIONNAME>. System.Net.Requests: The remote server returned an error: (403) Server failed to authenticate the request. Make sure
the value of Authorization header is formed correctly including the signature..

I am accessing the URI using below code

string image = req.Query["image"];

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,016 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful