google-cloud-platformgoogle-cloud-datastoregoogle-cloud-vertex-aigoogle-cloud-aivertex-ai-search

Getting "Configuration is not authorized" error while deploying GCP Vertex AI Agent on App Engine


I am building a search app using GCP Vertex AI Agent Builder and trying to deploy that on App Engine.

This is my Vertex AI search app.

enter image description here

This is Vertex AI app datastore

enter image description here

This is my App Engine code:

main.py

from flask import Flask, render_template
import os

app = Flask(__name__)


@app.route("/", methods=['POST', 'GET'])
def root():
    return render_template("index.html")


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)), debug=True)

index.html

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8">
    <title>TTC Intranet</title>
  </head>
  <body>
    <h1>TTC Intranet Search</h1>
    <!-- Widget JavaScript bundle -->
    <script src="https://cloud.google.com/ai/gen-app-builder/client?hl=en_US"></script>

    <!-- Search widget element is not visible by default -->
    <gen-search-widget
      configId="21a52013-xxxx-xxxx-xxxx-xxxx80a5xxxx"
      triggerId="searchWidgetTrigger">
    </gen-search-widget>

    <!-- Element that opens the widget on click. It does not have to be an input -->
    <input placeholder="Search here" id="searchWidgetTrigger" />
  </body>
</html>

app.yaml

runtime: python39

The app is starting and upon clicking "search here" icon, it is redirecting to search agent page. But then it is giving below error.

Configuration is not authorized on "***.uc.r.appspot.com"


Solution

  • You must configure the authorized domains/subdomains under the Vertex Agent Builder Application in order for this to work.

    Vertex AI Configuration

    In your case you would add the xxxx.xx.r.appspot.com (and any other domains you're using) to the authorized list.