Issue Description
I’m working on a Flask application that uses Vertex AI Search functionality and I’m trying to get it running on Google App Engine. Everything seems to work fine locally, but when I deploy to App Engine, I run into authorization problems.
My Setup
Here’s my Flask application code:
server.py
from flask import Flask, render_template
import os
server = Flask(__name__)
@server.route("/", methods=['GET', 'POST'])
def home():
return render_template("search.html")
if __name__ == '__main__':
server.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)), debug=True)
search.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Company Search Portal</title>
</head>
<body>
<h1>Internal Search System</h1>
<script src="https://cloud.google.com/ai/gen-app-builder/client?hl=en_US"></script>
<gen-search-widget
configId="34b71024-yyyy-yyyy-yyyy-yyyy91c6yyyy"
triggerId="searchTrigger">
</gen-search-widget>
<input placeholder="Enter search query" id="searchTrigger" />
</body>
</html>
app.yaml
runtime: python39
The Problem
When I deploy this to App Engine and try to use the search widget, I get this error message:
Configuration is not authorized on “***.uc.r.appspot.com”
The app loads fine and the search input appears, but clicking on it to trigger the search widget results in this authorization error. Has anyone encountered this issue before? What am I missing in my configuration?