When you create and deploy a static html website on Azure static web apps, the 404 page will show a default Azure 404 page. Here is the code to change this page to a custom 404 page.
Create a custom 404 page on an Azure static web app.
Create file staticwebapp.config.json in the root of your website.