Deploy Azure Open AI Java reference template on Azure Container Apps production ready environment using ACA LZA
- Clone the ACA LZA Java App accelerator repo.
git clone https://github.com/Azure-Samples/chat-with-your-data-java-lza-app-accelerator.git
- Run
cd chat-with-your-data-java-lza-app-accelerator/infra/aca
- Review the bicep parameters in
bicep/chat-with-your-data-java-aca-main.parameters.json
.Pay attention to vmLinuxSshAuthorizedKeys param: you should provide here the a public key that you have generated along with your private key. For more information on how to generate a public key see here. - Run
azd auth login
to authenticate with your Azure subscription. - Run
azd provision
to provision the infrastructure and when asked by the prompt provide an env name and the deployment region (take note of them).This will take several minutes (about 30/40 min) and will:- Download the ACA lza code in the folder
infra/aca/bicep/lza-libs
. - Automatically run the ACA lza bicep source code.
- Automatically run the java app bicep source code in the folder
chat-with-your-data-java-lza-app-accelerator\infra\aca\bicep\modules
. This will create the Azure supporting services (Azure AI Search, Azure Document Intelligence, Azure Storage, Azure Event Grid, Azure Service Bus) required by the app to work following the best practices provided by the ACA LZA infrastructure. - Automatically create
.azure
folder with azd env configuration. you should see a folder like this:chat-with-your-data-java-lza-app-accelerator\infra\aca\.azure
- Download the ACA lza code in the folder
- Connect to the jumpbox using bastion:
- (Jumpbox) Run
git clone https://github.com/Azure-Samples/chat-with-your-data-java-lza-app-accelerator.git
- (Jumpbox) Run
cd chat-with-your-data-java-lza-app-accelerator
- (Jumpbox) Run
./infra/aca/bicep/modules/vm/jumpbox-tools-setup.sh
to complete tools installation required for documents ingestion. - (Jumpbox) Run
./scripts/download-app-source.sh --branch main
to download the chat-with-your-data-java source code - (Jumpbox) Run
cd infra/aca
- (Jumpbox) Run
./scripts/download-aca-internal-lza.sh --branch feat/openai-chat-java
- (Jumpbox) Run
azd auth login --use-device-code
copy the code and open a web browser from your local machine pointing to the urlmicrosoft.com/devicelogin
. Paste the code and authenticate with your Azure subscription. - (Jumpbox) Run
azd env refresh
. When asked be sure to provide the same env name and location you used when you've run azd provision on your local machine. - (Jumpbox) Run
azd deploy
. This will build and deploy the java app. - (Jumpbox) Run
./scripts/prepdocs.sh
to ingest the predefined documents in the data folder. Allow few minutes for the documents to be ingested in the Azure AI Search index. You can check the status of the ingestion in the Azure portal in indexer app log stream. - From your local browser connect to the public azure application gateway using https. To retrieve the App Gateway public IP address, go to the Azure portal and search for the application gateway resource in the spoke resource group. In the overview page copy the "Frontend public IP address" and paste it in your browser.
- Putting the content of your id-rsa.pub file containing the public key in the bicep params files it's not working. As a workaround you can setup it using the following command:
az vm user update --resource-group {spoke resource group name} --name {vm name} --username azureuser --ssh-key-value {path-to-your-pub-key}
- Using the "Microsoft.Compute/virtualMachines/runCommands" bicep resource to automatically setup jumpbox VM with tools dependencies might not work.As a workaround, while you are on connected to the jumpbox, you can run manually the script in the
chat-with-your-data-java-lza-app-accelerator/infra/aca/bicep/modules/vm/jumpbox-tools-setup.sh
file.