Hello @Oliver Mitchell ,
The error “A wildcard application already exists” usually means WAP already has a publication covering that hostname/domain with a wildcard URL, so the new application conflicts with the existing publication.
A couple of things I'd check first:
• Run Get-WebApplicationProxyApplication on the WAP server and look for an existing application whose ExternalUrl/InternalUrl uses *.<domain> or otherwise covers the same host.
• If you already have something like https://*.apps.contoso.com, you generally shouldn't create another wildcard publication for the same domain just to add another path.
• If your requirement is actually path-based routing, be careful with the URL model. For example, https://apps.contoso.com/app1 and https://apps.contoso.com/app2 are not the same thing as publishing separate wildcard subdomains. WAP wildcard applications are designed around wildcard host names such as https://*.domain, with specific constraints on the internal/external URL format.
• Check for a stale/duplicate publication as well. If the second app was partially created and failed, it may be worth exporting the current WAP application configuration and checking all existing ExternalUrl/InternalUrl values before creating anything else.
I'd also verify whether the intended design is really multiple applications behind one shared root hostname using URL paths. If that's the requirement, WAP's application model may not be the right place to implement arbitrary path routing; a reverse proxy/load balancer layer is often a better fit for /app1, /app2, etc.
So before changing DNS, I'd run:
Get-WebApplicationProxyApplication |
Select Name, ExternalUrl, InternalUrl
and check whether an existing wildcard publication is already covering the same domain.
If you post the existing ExternalUrl/InternalUrl values (redacting the real domain), it should be possible to tell whether this is a duplicate wildcard or a path-routing design issue.