Error deploying Vertex AI Agent on App Engine: 'Configuration not authorized'

I’m having trouble with my search application that uses Vertex AI Agent Builder. I’m trying to put it on App Engine, but I’m running into a roadblock.

My setup includes a Vertex AI search app and a datastore. I’ve got a basic Flask app with a single route and an HTML template that includes the Gen App Builder client script.

Here’s a simplified version of my code:

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('search.html')

if __name__ == '__main__':
    app.run()

The HTML file has a search widget and a trigger element:

<gen-search-widget config-id="my-config-id" trigger-id="search-trigger"></gen-search-widget>
<input id="search-trigger" placeholder="Start searching">

When I deploy and try to use the search, I get this error:

Configuration is not authorized on [my-app-id].appspot.com

Any ideas what could be causing this? Is there some extra step I’m missing to authorize the configuration on App Engine?

hey swiftcoder42, sounds like a permissions issue. make sure ur app engine service account has the necessary roles for vertex ai. chek the IAM settings and give it ‘Vertex AI User’ role. also, double-check if the config ID matches whats in vertex AI. hope this helps!