Create new environment (3-16 chars, alphanumeric only)
July 23, 2026 · View on GitHub
Option A: VS Code Dev Containers (Recommended)
⚠️ Note for macOS Developers: If you are using macOS on Apple Silicon (ARM64) the DevContainer will not work. This is due to a limitation with the Azure Functions Core Tools (see here). We recommend using the Option B (Local Environment) instructions below to run the accelerator locally.
Prerequisites:
- Docker Desktop installed and running
- VS Code with Dev Containers extension
Steps:
- Start Docker Desktop
- Click the badge above to open in Dev Containers
- Wait for the container to build and start (includes all development tools)
- Proceed to Step 3: Configure Azure Resources
💡 Tip: Visual Studio Code should recognize the available development container and ask you to open the folder using it. For additional details on connecting to remote containers, please see the Open an existing folder in a container quickstart.
Option B: Local Environment
Required Tools:
- A code editor. We recommend Visual Studio Code, with the following extensions:
- Python 3.11
- Node.js LTS
- Azure Developer CLI (v1.18.0+)
- Azure CLI (v2.87.0+ required for post-deployment scripts)
- Bicep CLI (v0.33.0+)
- Azure Functions Core Tools
- Git
- PowerShell 7.0+
Setup Steps:
-
Install all required deployment tools listed above
-
Clone the repository:
azd init -t chat-with-your-data-solution-accelerator -
Open the project folder in your terminal
-
Review the contents of .devcontainer/setupEnv.sh and then run it:
.devcontainer/setupEnv.sh -
Select the Python interpreter in Visual Studio Code:
- Open the command palette (
Ctrl+Shift+PorCmd+Shift+P). - Type
Python: Select Interpreter. - Select the Python 3.11 environment created by
uv.
- Open the command palette (
-
Proceed to Step 3: Configure Azure Resources
PowerShell Users: If you encounter script execution issues, run:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Step 3: Configure Deployment Settings
Review the configuration options below. You can customize any settings that meet your needs, or leave them as defaults to proceed with a standard deployment.
3.1 Choose Deployment Type (Optional)
| Aspect | Development/Testing (Default) | Production |
|---|---|---|
| Configuration File | main.parameters.json (sandbox) | Copy main.waf.parameters.json to main.parameters.json |
| Security Controls | Minimal (for rapid iteration) | Enhanced (production best practices) |
| Cost | Lower costs | Cost optimized |
| Use Case | POCs, development, testing | Production workloads |
| Framework | Basic configuration | Well-Architected Framework |
| Features | Core functionality | Reliability, security, operational excellence |
To use production configuration:
Copy the contents from the production configuration file to your main parameters file:
- Navigate to the
infrafolder in your project - Open
main.waf.parameters.jsonin a text editor (like Notepad, VS Code, etc.) - Select all content (Ctrl+A) and copy it (Ctrl+C)
- Open
main.parameters.jsonin the same text editor - Select all existing content (Ctrl+A) and paste the copied content (Ctrl+V)
- Save the file (Ctrl+S)
3.2 Set VM Credentials (Optional - Production Deployment Only)
Note: This section only applies if you selected Production deployment type in section 3.1. VMs are not deployed in the default Development/Testing configuration.
By default, random GUIDs are generated for VM credentials. To set custom credentials:
azd env set AZURE_ENV_VM_ADMIN_USERNAME <your-username>
azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
3.3 Advanced Configuration (Optional)
Configurable Parameters
You can customize various deployment settings before running azd up, including Azure regions, AI model configurations (deployment type, version, capacity), container registry settings, and resource names.
📖 Complete Guide: See Parameter Customization Guide for the full list of available parameters and their usage.
Reuse Existing Resources
To optimize costs and integrate with your existing Azure infrastructure, you can configure the solution to reuse compatible resources already deployed in your subscription.
Supported Resources for Reuse:
-
Log Analytics Workspace: Integrate with your existing monitoring infrastructure by reusing an established Log Analytics workspace for centralized logging and monitoring.
-
Resource Group: Leverage an existing resource group to organize resources within your current Azure infrastructure. Follow the setup steps here before running
azd up
Key Benefits:
- Cost Optimization: Eliminate duplicate resource charges
- Operational Consistency: Maintain unified monitoring and AI infrastructure
- Faster Deployment: Skip resource creation for existing compatible services
- Simplified Management: Reduce the number of resources to manage and monitor
Important Considerations:
- Ensure existing resources meet the solution's requirements and are in compatible regions
- Review access permissions and configurations before reusing resources
- Consider the impact on existing workloads when sharing resources
Step 4: Deploy the Solution
4.1 Authenticate with Azure
azd auth login
For specific tenants:
azd auth login --tenant-id <tenant-id>
Finding Tenant ID:
- Open the Azure Portal.
- Navigate to Microsoft Entra ID from the left-hand menu.
- Under the Overview section, locate the Tenant ID field. Copy the value displayed.
4.2 Start Deployment
NOTE: If you are running the latest azd version (version 1.23.9), please run the following command.
azd config set provision.preflight off
azd up
During deployment, you'll be prompted for:
- Environment name (e.g., "cwyd") - Must be 3-16 characters long, alphanumeric only
- Azure subscription selection
- Location - Select the region where your infrastructure resources will be deployed
- Resource group selection (create new or use existing)
Expected Duration: 25-30 minutes for default configuration
4.3 Get Application URL
After successful deployment, locate your application URL:
- Open the Azure Portal
- Navigate to your resource group
- Locate the Container Apps - you will find three services:
- Frontend: the React web app, with the admin interface built in at the
/adminpath - Backend: the FastAPI API
- Functions: the ingestion worker
- Frontend: the React web app, with the admin interface built in at the
- Open the frontend Container App and copy its Application Url from the overview page
Example URLs:
- Application:
https://<frontend-container-app-name>.<region>.azurecontainerapps.io/ - Admin interface:
https://<frontend-container-app-name>.<region>.azurecontainerapps.io/admin
⚠️ Important: Complete Post-Deployment Steps before accessing the application.
Step 5: Post-Deployment Configuration
5.1 Run Post-Deployment Setup Script (Required)
After deployment completes, run the post-deployment script to configure the Function App client key and create PostgreSQL tables (if applicable).
Login to Azure CLI:
The post-deployment script uses Azure CLI (az) commands. Ensure you are logged in before running it:
az login
For specific tenants:
az login --tenant-id <tenant-id>
Important: The post-deployment script requires Azure CLI version 2.87.0 or later.
Check your installed version:
az versionIf your version is earlier than 2.87.0, upgrade Azure CLI before running the script:
az upgrade
PowerShell (Windows):
.\infra\scripts\post-provision\post_deployment_setup.ps1 -ResourceGroupName "<your-resource-group-name>"
Bash (Linux/macOS/WSL):
bash infra/scripts/post-provision/post_deployment_setup.sh "<your-resource-group-name>"
Note: The script auto-discovers all resources in the resource group. It handles private networking (WAF) deployments by temporarily enabling public access, performing the setup, then restoring the original state.
5.2 Build, Push, and Update Container Images (Container Model Only)
📌 Skip this step if you deployed with the default
hostingModel=code.
When deploying with hostingModel=container, the Container Apps start with a placeholder image. After provisioning, run the combined container workflow to build and push the application images to your Azure Container Registry and update the Container Apps to use them.
PowerShell (Windows):
.\infra\scripts\post-provision\acr_build_push_update.ps1 -ResourceGroupName "<your-resource-group-name>"
Bash (Linux/macOS/WSL):
bash infra/scripts/post-provision/acr_build_push_update.sh -g "<your-resource-group-name>"
This script:
- Builds and pushes the images to your ACR
- Updates each Container App to pull its image from your private ACR using managed-identity authentication
- Restarts all services
By default, images are built remotely using
az acr build(no local Docker required). To build locally with Docker instead, use-Mode localin PowerShell or--mode localin Bash. You can also set a custom tag with-Tagor--tag.
Re-deployment note: If you re-run
azd provision, run this script again to restore the correct container images.
5.3 Configure Authentication (Required for Chat Application)
This step is mandatory for Chat Application access:
- Follow App Authentication Configuration
- Wait up to 10 minutes for authentication changes to take effect
5.4 Verify Deployment
- Access your application using the URL from Step 4.3
- Confirm the application loads successfully
- Verify you can sign in with your authenticated account
5.5 Test the Application
Quick Test Steps:
- Open the admin interface at the
/adminpath, where you can upload documents. Select Ingest Data and add your data. You can find sample data in the data directory. - Return to the chat web app to start chatting on top of your data.
Step 6: Clean Up (Optional)
Remove All Resources
azd down
Note: If you deployed with
enableRedundancy=trueand Log Analytics workspace replication is enabled, you must first disable replication before runningazd downelse resource group delete will fail. Follow the steps in Handling Log Analytics Workspace Deletion with Replication Enabled, wait until replication returnsfalse, then runazd down.
Manual Cleanup (if needed)
If deployment fails or you need to clean up manually:
- Follow Delete Resource Group Guide
Managing Multiple Environments
Recover from Failed Deployment
If your deployment failed or encountered errors, here are the steps to recover:
Recover from Failed Deployment
If your deployment failed or encountered errors:
- Try a different region: Create a new environment and select a different Azure region during deployment
- Clean up and retry: Use
azd downto remove failed resources, thenazd upto redeploy - Fresh start: Create a completely new environment with a different name
Example Recovery Workflow:
# Remove failed deployment (optional)
azd down
# Create new environment (3-16 chars, alphanumeric only)
azd env new cwydretry
# Deploy with different settings/region
azd up
Creating a New Environment
If you need to deploy to a different region, test different configurations, or create additional environments:
Create a New Environment
Create Environment Explicitly:
# Create a new named environment (3-16 characters, alphanumeric only)
azd env new <new-environment-name>
# Select the new environment
azd env select <new-environment-name>
# Deploy to the new environment
azd up
Example:
# Create a new environment for production (valid: 3-16 chars)
azd env new cwydprod
# Switch to the new environment
azd env select cwydprod
# Deploy with fresh settings
azd up
Environment Name Requirements:
- Length: 3-16 characters
- Characters: Alphanumeric only (letters and numbers)
- Valid examples:
cwyd,test123,myappdev,prod2024- Invalid examples:
cd(too short),my-very-long-environment-name(too long),test_env(underscore not allowed),myapp-dev(hyphen not allowed)
Switch Between Environments
List Available Environments:
azd env list
Switch to Different Environment:
azd env select <environment-name>
View Current Environment Variables:
azd env get-values
Best Practices for Multiple Environments
- Use descriptive names:
cwyddev,cwydprod,cwydtest(remember: 3-16 chars, alphanumeric only) - Different regions: Deploy to multiple regions for testing quota availability
- Separate configurations: Each environment can have different parameter settings
- Clean up unused environments: Use
azd downto remove environments you no longer need
Deploy Using Bicep Directly
If you prefer not to use azd, you can deploy using the Bicep file directly.
A Bicep file is used to generate the ARM template. You can deploy this accelerator with the following command:
az deployment sub create --template-file ./infra/main.bicep --subscription {your_azure_subscription_id} --location {your_preferred_location}
Next Steps
Now that your deployment is complete and tested, explore these resources to enhance your experience:
📚 Learn More:
- Model Configuration - Configure AI models and parameters
- Best Practices - Best practices for deployment and usage
- Local Development Setup - Set up your local development environment
Need Help?
- 🛠️ **Troubleshooting: ** Refer to the TroubleShootingSteps document
- 💬 Support: Review Support Guidelines
- 🔧 Development: See Contributing Guide
Back to Chat with your data README

Overview
Chat with Your Data deploys to Azure with the Azure Developer CLI (azd). One command provisions every resource, builds the three container images, deploys them to Azure Container Apps, and seeds a sample corpus so chat works on the first run. There is no portal template and no one-click button to configure.
Estimated time: 20 to 40 minutes, most of which is unattended provisioning.
Prerequisites
- An Azure subscription with permission to create resources and assign roles. See Managed identity and RBAC for the roles the deployment assigns.
- Azure Developer CLI version 1.18.0 or later. Version 1.23.9 is not supported.
- Azure CLI.
- Model capacity for the chat and embedding models in your target region. See Azure OpenAI model quota settings and Quota check.
Tip
The default AI service region is eastus2. Choose a region that has capacity for the configured models, or set a different region at the prompt.
Deploy with azd
Sign in, then provision and deploy in one step.
azd auth login
azd up
azd up prompts for a few typed parameters and stores them in your azd environment.
| Prompt | Values | Notes |
|---|---|---|
databaseType | cosmosdb (default), postgresql | Chooses the retrieval index and chat history platform. Locked after deployment. |
azureAiServiceLocation | Azure region | Region for the Azure AI Foundry models. Defaults to eastus2. |
enableMonitoring | true, false | Adds Log Analytics and Application Insights. Defaults to false. |
enableScalability | true, false | Reliability and scale flag. Defaults to false. |
enableRedundancy | true, false | Redundancy flag. Defaults to false. |
enablePrivateNetworking | true, false | Adds a virtual network, private DNS, and a bastion host. Defaults to false. |
See Customizing azd parameters for the complete list of options.
What azd up does
flowchart TD A[azd auth login] --> B[azd up] B --> C[Provision infra<br/>Bicep main.bicep] C --> D[postprovision hook<br/>post-provision script] D --> E[Deploy 3 services<br/>images built in ACR remoteBuild] E --> F[postdeploy hook<br/>upload-sample-data seeds corpus] F --> G[Application URL ready]
- Provision. Bicep (
infra/main.bicep) creates the resource group contents described in Architecture overview. - Post-provision. A script prepares data-plane state, such as enabling the
pgvectorextension inpostgresqlmode or seeding the knowledge base incosmosdbmode. - Deploy. The backend, frontend, and ingestion images build remotely in the container registry, so you do not need Docker installed. The Container Apps are then updated to the new images.
- Post-deploy. A script seeds a sample document set and enqueues it for ingestion so chat returns grounded answers immediately.
When the command finishes, azd prints the application URL.
Deploy changes to a single service
After the first azd up, you can redeploy one service without reprovisioning.
azd deploy backend
azd deploy frontend
azd deploy function
Clean up
Delete every resource created by the deployment when you are done.
azd down
Warning
azd down permanently deletes the deployed resources and all ingested data. Export anything you need first.