Skip to content

Commit

Permalink
dev: Simplify a lot the deployment required config
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 22, 2024
1 parent e926a80 commit 728e1c3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,37 @@ Container is available on GitHub Actions, at:
- Latest version from a branch: `ghcr.io/clemlesne/claim-ai-phone-bot:main`
- Specific tag: `ghcr.io/clemlesne/claim-ai-phone-bot:0.1.0` (recommended)

Create a local `config.yaml` file (most of the fields are filled automatically by the deployment script):

```yaml
# config.yaml
api: {}
database:
cosmos_db: {}
resources: {}
workflow:
agent_phone_number: "+33612345678"
bot_company: Contoso
bot_name: Robert
communication_service:
phone_number: "+33612345678"
voice_name: fr-FR-DeniseNeural
cognitive_service:
endpoint: https://xxx.cognitiveservices.azure.com
openai: {}
```

Steps to deploy:

1. Create an Communication Services resource with a phone number
2. Create a local `config.yaml` file (be sure to use the phone number previously created)
3. Connect to (for example `az login`)
1. Create an `Communication Services` resource plus a `Phone Number`
2. Create the local `config.yaml`
3. Connect to your Azure environment (e.g. `az login`)
4. Run deployment with `make deploy name=my-instance`
5. Wait for the deployment to finish
6. Get the logs with `make logs name=my-instance`
Expand Down
25 changes: 25 additions & 0 deletions bicep/app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var appUrl = 'https://claim-ai.${acaEnv.properties.defaultDomain}'
var gptModelFullName = toLower('${gptModel}-${gptVersion}')

output appUrl string = appUrl
output blobStoragePublicName string = storageAccount.name
output communicationId string = communication.id

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
Expand Down Expand Up @@ -93,6 +94,30 @@ resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
name: 'DATABASE_COSMOS_DB_DATABASE'
value: database.name
}
{
name: 'RESOURCES_PUBLIC_URL'
value: storageAccount.properties.primaryEndpoints.web
}
{
name: 'COMMUNICATION_SERVICE_ENDPOINT'
value: communication.properties.hostName
}
{
name: 'COMMUNICATION_SERVICE_ACCESS_KEY'
value: communication.listKeys().primaryKey
}
{
name: 'OPENAI_ENDPOINT'
value: cognitiveOpenai.properties.endpoint
}
{
name: 'OPENAI_GPT_DEPLOYMENT'
value: gpt.name
}
{
name: 'OPENAI_GPT_MODEL'
value: gptModel
}
]
resources: {
cpu: 1
Expand Down
3 changes: 2 additions & 1 deletion bicep/main.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param config string
param imageVersion string = 'main'
param imageVersion string = 'develop'
param gptModel string = 'gpt-4'
param gptVersion string = '1106-Preview'
param instance string = deployment().name
Expand All @@ -9,6 +9,7 @@ param openaiLocation string = 'swedencentral'
targetScope = 'subscription'

output appUrl string = app.outputs.appUrl
output blobStoragePublicName string = app.outputs.blobStoragePublicName
output communicationId string = app.outputs.communicationId

var tags = {
Expand Down

0 comments on commit 728e1c3

Please sign in to comment.