Azure OpenAI ChatGPT App Documentation
Azure OpenAI ChatGPT App Documentation
Features
The key features of this application include:
Cost Estimation
Costs vary depending on usage and region. The Azure pricing calculator can estimate costs
for the following resources:
• Azure App Service: Basic Tier with 1 CPU core, 1.75 GB RAM
• Azure OpenAI: Standard tier, GPT and Ada models (priced per 1K tokens used)
• Azure AI Document Intelligence: SO tier using pre-built layout (priced per document
page)
• Azure AI Search: Basic tier, 1 replica, free level of semantic search
• Azure Blob Storage: Standard tier with ZRS (Zone-redundant storage)
• Azure Monitor: Pay-as-you-go tier (costs based on data ingested)
To reduce costs, consider using free SKUs for various services. Be sure to take down the app
if it is no longer in use to avoid unnecessary expenses.
Getting Started
The project can be set up in multiple environments: GitHub Codespaces, VS Code Dev
Containers, or a local environment. The easiest method is GitHub Codespaces, which sets up
all the necessary tools in a web-based VS Code environment.
GitHub Codespace
You can run this repo virtually by using GitHub Codespaces, which will open a web-based
VS Code in your browser:
Once the codespace opens (this may take several minutes), open a terminal window
Local environment
Note that this command will initialize a git repository, so you do not need
to clone this repository.
Deployment
Follow these steps to provision Azure resources and deploy the application:
Clean Up
To delete all resources created by this sample, run the command `azd down` and confirm
deletion when prompted.
Deploy again
If you’ve only changed the backend/frontend code in the app folder, then you don’t need to re-
provision the Azure resources. You can just run:
Azd deploy
If you’ve changed the infrastructure files (infra folder or azure.yaml), then you’ll need to re-
provision the Azure resources. You can do that by running:
Azd up
Sharing environments
4. Set the environment variable AZURE_PRINCIPAL_ID either in that .env file or in the
active shell to their Azure ID, which they can get with az ad signed-in-user show.
Running locally
You can only run locally after having successfully run the azd up command. If you
haven’t yet, follow the Deploying
Steps above.
1. Run azd auth login
2. Change dir to app
3. Run ./start.ps1 or ./start.sh or run the “VS Code Task: Start App” to start the
project locally.
See more tips in the local development guide
• Try different topics in chat or Q&A context. For chat, try follow up questions,
clarifications, ask to simplify or elaborate on answer, etc.
• Explore citations and sources
• Click on “settings” to try different options, tweak prompts, etc.
Clean up
To clean up all the resources created by this sample:
Guidance
Besides the tips below, you can find extensive documentation in the docs folder.
To see the performance data, go to the Application Insights resource in your resource group,
click on the “Investigate -> Performance” blade and navigate to any HTTP request to see the
timing data. To inspect the performance of chat requests, use the “Drill into Samples” button to
see end-to-end traces of all the API calls made for any chat request:
You can also see chart summaries on a dashboard by running the following command:
Azd monitor
Productionizing
This sample is designed to be a starting point for your own production application, but you
should do a thorough review of the security and performance before deploying to production.
Read through our Productionization Guide or more details.
Troubleshooting
Here are the most common failure scenarios and solutions:
1. The subscription (AZURE_SUBSCRIPTION_ID) doesn’t have access to the Azure OpenAI
service. Please ensure AZURE_SUBSCRIPTION_ID matches the ID specified in the Open Ai
Access Request guide.
2. You’re attempting to create resources in regions not enabled for Azure OpenAI (e.g. East
US 2 instead of East US), or where the model you’re trying to use isn’t enabled. See
this matrix of model availability .
3. You’ve exceeded a quota, most often number of resources per region. See
this article on quotas and limits.
4. You’re getting “same resource name not allowed” conflicts. That’s likely because you’ve
run the sample multiple times and deleted the resources you’ve been creating each
time, but are forgetting to purge them. Azure keeps resources for 48 hours unless you
purge from soft delete. See this article on purging resources.
5. You see CERTIFICATE_VERIFY_FAILED when the prepdocs.py script runs. That’s typically
due to incorrect SSL certificates setup on your machine. Try the suggestions in this
StackOverflow Answer.
6. After running azd up and visiting the website, you see a ‘404 Not Found’ in the browser.
Wait 10 minutes and try again, as it might be still starting up. Then try running azd
deploy and wait again. If you still encounter errors with the deployed app, consult the
guide on debugging app service deployments.Please file an issue if the logs don’t help
you resolve the error.
Getting help
This is a sample built to demonstrate the capabilities of modern Generative AI apps and
how they can be built in Azure. For help with deploying this sample, please post in Git
Hub issues . If you’re a Microsoft employee, you can also post in our Teams channel.
This repository is supported by the maintainers, not by Microsoft Support, so please use
the support mechanisms described above, and we will do our best to help you out.