Yeah this is a classic domain authorization problem. I ran into this exact same thing when we migrated our internal search tool to App Engine last year.
The issue is that Vertex AI Search has domain restrictions by default. Your local development works because localhost is usually allowed, but production domains need explicit authorization.
Here’s what you need to do:
- Go to the Google Cloud Console
- Navigate to Vertex AI Search & Conversation
- Find your search app configuration
- Look for “Allowed domains” or “Domain restrictions” settings
- Add your App Engine domain:
myapp.uc.r.appspot.com
One thing to watch out for - if you’re using custom domains later, you’ll need to add those too. Also make sure you’re adding the exact domain format that shows in the error message.
I’ve seen this setup work really well for enterprise search applications. Here’s a practical walkthrough that covers the whole process:
After you update the domain settings, it should work right away. No need to redeploy your app.