Welcome to the Digital Power AI chatbot solution based on this Azure sample repository.
Since the authors of the Azure sample project have already documented almost all you need to know, this README is meant to quickly navigate to the relevant parts.
The project constists of the following directories:
/app
contains the Python (Quart) backend and the Typescript (React) frontend./assets
contains images used in the app./data
contains the files that are used to build the knowledge base. This is the data that the chatbot uses to answer questions!/docs
contains markdown files with documentation./infra
contains the Bicep files defining the required Azure resources./scripts
contains Shell & PowerShell scripts for adhoc functionalities./tests
contains Pytest tests
To collaborate on this project in an organised way we follow the Github flow principles. This effectively means that all changes require a separate branch and a pull request to the main
branch with reviewers to process them.
The easiest way to change the underlying data that the chatbot uses, is to replace the files in the /data
folder. After committing and pushing the code the to remote main
branch, a "deploy" pipeline will upload the data to the Azure environment.
Uploading new documents will NOT delete the already existings data. To remove documents contact an owner.
If you are an owners of this project you can also use the prepdocs
script to directly parse and upload documents from your local environment. You can add the --remove
or --removeall
flag in the shell script to delete data from the index. Check prepdocs.py on how to use them.
For the infrastructure you can use the same method as for data by first changing the Bicep files in the /infra
folder. Secondly, after committing and pushing the code the to remote main
branch, a "deploy" pipeline will update the infrastructure of the Azure environment.
If you are an owners of this project you can also the azd deploy
command to directly update the infrastructure from your local environment. However, it is highly recommended to use the pipeline method as well!
If you want to make changes to the app, you need to test them locally. Therefore, you need to be able to run the app locally which requires the right access and setting up the environment.
Ask one of the owners to add you to the chatdip user group and assign you the Reader
role on the Digital Power Playground subscription.
To run the app locally:
- Install the Azure Developer CLI
- Run
azd auth login
- Run
azd env refresh -e chat-dip-dev
- When prompted, choose the Digital Power Playground subscription
- When prompted, choose West-Europe as the region, if it is not an option (for
openAiResourceGroupLocation
) choose France Central
Instructions on running the local environment can be found here.
To map a custom domain to the app, the following steps need to be taken:
- Make sure your domain is registered by your hosting provider.
- Share the CNAME records with the hosting provider.
- Go to the Azure portal and navigate to the web app.
- Go to the custom domains tab and add the custom domain.
- Export the CNAME records and share them with the hosting provider.
- Deploy the Bicep code in the correct order.
- Go to
infra/core/host/appservice.bicep
- Add
depends_on
block to thecertificates
resource withappService
as the dependency. - Outcomment the
thumbprint
property in theappService/hostNameBinding
resource. - Set
sslState
to Disabled - Run
azd provision
to create the certificate and set the custom domain. - Remove the
depends_on
block from thecertificates
resource. - After deployment, uncomment the
thumbprint
property - Set
sslState
to SniEnabled. - Run
azd provision
to set the host binding to use the certificate.
- Go to
- Myrthe Lammerse myrthe.lammerse@digital-power.com
- Roy Klip roy.klip@digital-power.com
- Casper Damen casper.damen@digital-power.com