[@JOSEPH PAWLOWSKI(/users/na/?userid=348f3946-8f4b-47ad-aad0-fb92879d6233) Thanks for reaching out. I don't see any of your HTML code. For your reference sharing the code how to call any HTTP POST request. To authenticate azure function, you need to pass x-functions-key in your request as documented here or in the query string. The below is just for reference and I will suggest you to use fiddler/postman to test the function endpoint to verify if you are getting right response. I believe you have already tested running the local webpage but to double confirm.
For your reference I have tested the same using the above code and it works fine. You can debug the page locally F12 on your browser and check for any error/issue.
Note: You might get CORS issue so make sure to add the URL in the CORS setting of your function app. You can also set it to * to resolve the CORS issue if you face any.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Call Azure Function from HTML</title>
</head>
<body>
<div id="demo">
<h1>Request</h1>
<button type="button" onclick="callFunction()">Call Function</button>
</div>
<script>
function callFunction() {
const xhr = new XMLHttpRequest();
const url = 'https://<functionappname>.azurewebsites.net/api/HttpTrigger1?code=yourkey';
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
document.getElementById("demo").innerHTML = xhr.responseText;
}
};
const data = JSON.stringify({
// Request body goes here
});
xhr.send(data);
}
</script>
</body>
</html>