public async Task <IActionResult> GetAzureIpInfo([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "ipinfo")] HttpRequest req) { string ipOrDomain = req.Query["ipOrDomain"]; if (string.IsNullOrEmpty(ipOrDomain)) { return(new BadRequestObjectResult("ipOrDomain can not be null")); } var result = await azureIpProvider.GetAzureIpInfo(ipOrDomain); logger.LogInformation("Function GetAzureIpInfo completed successfully"); return(new OkObjectResult(JsonConvert.SerializeObject(result))); }
public async Task TestGetAzureIpInfo() { await azureIpProvider.GetAzureIpInfo(ipAddress); ////mockAzureStorageProvider.Verify(_ => _.GetAzureIpInfoListAsync(), Times.Once); }