Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

dev: Automate resources upload to Container Storage

Clémence Lesné55d3f46d2ab8
diff --git a/Makefile b/Makefile
index ebe95f1..7034fd8 100644
--- a/Makefile
+++ b/Makefile
@@ -94,6 +94,9 @@ deploy:
--template-file bicep/main.bicep \
--name $(name)
+ $(MAKE) copy-resources \
+ name=$(shell az deployment sub show --name $(name) | yq '.properties.outputs["blobStoragePublicName"].value')
+
$(MAKE) eventgrid-register \
endpoint=$(shell az deployment sub show --name $(name) | yq '.properties.outputs["appUrl"].value') \
name=$(name) \
@@ -130,6 +133,16 @@ eventgrid-register:
--name $(name) \
--source-resource-id $(source)
+copy-resources:
+ @echo "📦 Copying resources to Azure storage account..."
+ az storage blob upload-batch \
+ --account-name $(name) \
+ --destination '$$web' \
+ --no-progress \
+ --output none \
+ --overwrite \
+ --source resources
+
watch-call:
@echo "👀 Watching status of $(phone_number)..."
while true; do \
diff --git a/README.md b/README.md
index 49f8cb1..bb8fc93 100644
--- a/README.md
+++ b/README.md
@@ -177,9 +177,9 @@ Then run:
make install
```
-Also, a public file server is needed to host the audio files.
+Also, a public file server is needed to host the audio files. Upload the files with `make copy-resources name=myinstance` (`myinstance` is the storage account name), or manually.
-For this, you can use Blob Storage. In that case, content of the project folder `resources` requires to be uploaded to the public container `$web` of the storage account. This folder contains:
+For your knowledge, this `resources` folder contains:
- Audio files (`xxx.wav`) to be played during the call
- [Lexicon file (`lexicon.xml`)](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup-pronunciation#custom-lexicon) to be used by the bot to understand the company products (note: any change [makes up to 15 minutes](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup-pronunciation#custom-lexicon-file) to be taken into account)