An Azure service that provides streamlined full-stack web app development.
Hello @AkashPoojary-7813
Since both domains were previously associated with other Azure subscriptions/resources, this likely isn't a DNS propagation issue.
Azure Static Web Apps requires a custom domain to be uniquely associated with a Static Web App. Microsoft specifically documents that a domain already bound to another Static Web Apps resource must first be disassociated from the original resource before it can be attached to another instance.
Removing the old DNS records does not remove Azure's internal custom-domain association. There are documented cases where the old Static Web App/subscription was deleted or became inaccessible, but the hostname remained registered on the Azure side, and attempts to reuse it produced:
domainName is invalid. The domain name given was not found.
That appears consistent with your situation.
First, check whether either domain is still attached to any Static Web App you can access:
az staticwebapp list --query "[].{Name:name,ResourceGroup:resourceGroup}" -o table
az staticwebapp hostname list \
--name <static-web-app-name> \
--resource-group <resource-group>
If neither kritivak.com nor petfrnd.com appears on any accessible resource, try adding one through the CLI with debug logging. This can expose a more useful backend error than the portal:
az staticwebapp hostname set \
--name <static-web-app-name> \
--resource-group <resource-group> \
--hostname kritivak.com \
--validation-method dns-txt-token \
--debug
If Azure still has the hostname associated with an old or inaccessible subscription, you can't change a DNS record to release that Azure-side binding. At that point, I recommend opening an Azure support request and asking Microsoft to investigate/release the stale Static Web Apps custom-hostname association. Include the two domain names, current Static Web App resource ID, previous subscription/resource details if available, and the correlation/error details from the CLI --debug output.
For the final configuration, since these are apex/root domains, Microsoft supports validating ownership with a TXT record and then routing the domain using an appropriate ALIAS, ANAME, CNAME flattening, or A record, depending on your DNS provider. Apex-domain DNS changes can take up to 72 hours to propagate.
In this case, don't keep deleting or recreating DNS records. If public DNS is already healthy and the portal fails before it can generate the TXT validation token, I'd start by investigating the previous Azure-side domain association.
Sharing these references with you:
Custom domains with Azure Static Web Apps
Configure an apex domain with external DNS
Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.