Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hello ENG Info,
Greetings! Thanks for raising this question in the Q&A forum
The Azure Marketplace offer is only a provisioning and billing option. It is not required for connecting an Azure App Service or Azure Container App to Neo4j. The recommended architecture is to run the application in Azure and keep Neo4j as a separate managed AuraDB service.
- Create AuraDB outside Azure Marketplace
Create an AuraDB Professional instance directly through the Neo4j Aura console using Neo4j billing. Select an Azure-hosted region close to your application when available.
AuraDB Professional supports public, TLS-encrypted connectivity. It does not currently include private endpoints or IP filtering. See the AuraDB pricing and feature comparison and supported regions.
Configure the Azure application
From the Aura console, obtain the connection URI, username, and password. In App Service, add these under Settings > Environment variables:
NEO4J_URI=neo4j+s://<instance-id>.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=<password>
Do not commit these values to source control. For production, store the password in Azure Key Vault and use an App Service Key Vault reference.
Connect using an official Neo4j driver
For example, a Python application can connect as follows:
import os
from neo4j import GraphDatabase
driver = GraphDatabase.driver(
os.environ["NEO4J_URI"],
auth=(
os.environ["NEO4J_USERNAME"],
os.environ["NEO4J_PASSWORD"],
),
)
driver.verify_connectivity()
Create one driver instance during application startup and reuse it because the driver manages connection pooling. Neo4j provides the same pattern for Java, JavaScript, .NET, and other supported languages in its application connectivity documentation.
Verify outbound connectivity
For neo4j+s://, the application must resolve the AuraDB hostname and reach TCP port 7687. If an organizational firewall blocks non-standard ports, Neo4j also provides the HTTPS Query API over port 443.
Use the Aura hostname rather than an IP address because TLS certificate validation and Aura routing depend on the fully qualified domain name. See Aura IP addresses and ports.
Choose App Service or Container Apps based on the application
App Service is suitable for a conventional web API. Container Apps is generally preferable when the GraphRAG solution contains separate API, ingestion, worker, or scheduled container workloads. This choice does not change how the application connects to AuraDB.
Use the appropriate option when private connectivity is mandatory
AuraDB Professional cannot provide Azure Private Link. For private-only connectivity, use an eligible AuraDB Virtual Dedicated Cloud deployment with Azure Private Link, then integrate App Service or the Container Apps environment with the corresponding VNet. See Neo4j Aura secure connections.
Self-hosting the Neo4j container on a VM or AKS is another option, but you would be responsible for persistent storage, backups, upgrades, availability, monitoring, and licensing. Hosting the database inside the same App Service as the web application is not recommended.
If this answer helps you kindly accept the answer which will help others who have similar questions.
Best Regards,
Jerald Felix.