Skip to content

Commit 728e1c3

Browse files
committed
dev: Simplify a lot the deployment required config
1 parent e926a80 commit 728e1c3

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

README.md

+29-3
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,37 @@ Container is available on GitHub Actions, at:
205205
- Latest version from a branch: `ghcr.io/clemlesne/claim-ai-phone-bot:main`
206206
- Specific tag: `ghcr.io/clemlesne/claim-ai-phone-bot:0.1.0` (recommended)
207207

208+
Create a local `config.yaml` file (most of the fields are filled automatically by the deployment script):
209+
210+
```yaml
211+
# config.yaml
212+
api: {}
213+
214+
database:
215+
cosmos_db: {}
216+
217+
resources: {}
218+
219+
workflow:
220+
agent_phone_number: "+33612345678"
221+
bot_company: Contoso
222+
bot_name: Robert
223+
224+
communication_service:
225+
phone_number: "+33612345678"
226+
voice_name: fr-FR-DeniseNeural
227+
228+
cognitive_service:
229+
endpoint: https://xxx.cognitiveservices.azure.com
230+
231+
openai: {}
232+
```
233+
208234
Steps to deploy:
209235

210-
1. Create an Communication Services resource with a phone number
211-
2. Create a local `config.yaml` file (be sure to use the phone number previously created)
212-
3. Connect to (for example `az login`)
236+
1. Create an `Communication Services` resource plus a `Phone Number`
237+
2. Create the local `config.yaml`
238+
3. Connect to your Azure environment (e.g. `az login`)
213239
4. Run deployment with `make deploy name=my-instance`
214240
5. Wait for the deployment to finish
215241
6. Get the logs with `make logs name=my-instance`

bicep/app.bicep

+25
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var appUrl = 'https://claim-ai.${acaEnv.properties.defaultDomain}'
1111
var gptModelFullName = toLower('${gptModel}-${gptVersion}')
1212

1313
output appUrl string = appUrl
14+
output blobStoragePublicName string = storageAccount.name
1415
output communicationId string = communication.id
1516

1617
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
@@ -93,6 +94,30 @@ resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
9394
name: 'DATABASE_COSMOS_DB_DATABASE'
9495
value: database.name
9596
}
97+
{
98+
name: 'RESOURCES_PUBLIC_URL'
99+
value: storageAccount.properties.primaryEndpoints.web
100+
}
101+
{
102+
name: 'COMMUNICATION_SERVICE_ENDPOINT'
103+
value: communication.properties.hostName
104+
}
105+
{
106+
name: 'COMMUNICATION_SERVICE_ACCESS_KEY'
107+
value: communication.listKeys().primaryKey
108+
}
109+
{
110+
name: 'OPENAI_ENDPOINT'
111+
value: cognitiveOpenai.properties.endpoint
112+
}
113+
{
114+
name: 'OPENAI_GPT_DEPLOYMENT'
115+
value: gpt.name
116+
}
117+
{
118+
name: 'OPENAI_GPT_MODEL'
119+
value: gptModel
120+
}
96121
]
97122
resources: {
98123
cpu: 1

bicep/main.bicep

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
param config string
2-
param imageVersion string = 'main'
2+
param imageVersion string = 'develop'
33
param gptModel string = 'gpt-4'
44
param gptVersion string = '1106-Preview'
55
param instance string = deployment().name
@@ -9,6 +9,7 @@ param openaiLocation string = 'swedencentral'
99
targetScope = 'subscription'
1010

1111
output appUrl string = app.outputs.appUrl
12+
output blobStoragePublicName string = app.outputs.blobStoragePublicName
1213
output communicationId string = app.outputs.communicationId
1314

1415
var tags = {

0 commit comments

Comments
 (0)