question

JAPNAMSINGH-6684 avatar image
0 Votes"
JAPNAMSINGH-6684 asked JAPNAMSINGH-6684 commented

azure functions "An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set."

Hi,

I am getting the error when I publish the azure function, locally it does not complain the URI The error message is "An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set."

var driveitempath =graphendpoint + "/sites/" + Environment.GetEnvironmentVariable("pdf:SiteId") + "/drive/items";

string url = drivesitempath + "/" + fileId + "/content?format=pdf"
httpClient.GetAsync(url);

So, if I hard-code the url it works ,but I am trying to achieve no hard-coded values.

azure-functions
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

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

@JAPNAMSINGH-6684 I will suggest to debug or log the value for individual parameter that you are using to build the URI and see if any of the parameter (i.e. graphendpoint etc.) is coming null or empty while retrieving the value. As per the error the parameter url is not correctly formed and while executing httpClient.GetAsync(url) it throws exception.
If you are getting the value from configuration of your function app. Please make sure that you have define the application setting and value on your function app.

· 1
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.