0

I am building an Azure function and just updated to latest everything, this is my code:

  log.Info($"C# Timer trigger function executed at: {DateTime.Now}");

  var localCall = httpClient.GetAsync(urls[EnvironmentNames.LOCAL]);
  var localCallResult = await localCall;

  log.Info($"{EnvironmentNames.LOCAL} call status code {localCallResult.StatusCode}");

The url is:

{EnvironmentNames.LOCAL, $"local.mysite.net:5050/doThings"},

I am getting the following error when testing locally in Visual Studio:

System.ArgumentException: Only 'http' and 'https' schemes are allowed.

Parameter name: requestUri

Can I not test Azure calls locally?

2
  • Any progress? If the solution works could you accept it to close your question?Otherwise just let us know where you are trapped. Commented Nov 4, 2018 at 2:40
  • @JerryLiu Accepted, thanks. Commented Nov 4, 2018 at 2:51

1 Answer 1

2

Make sure urls[EnvironmentNames.LOCAL] has a complete url value like http://local.mysite.net:5050/doThings. The protocol http:// or https:// can't be omitted as httpClient won't add it for us.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.