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: Step to download logs from the past day

Clémence Lesné1d70af2021eb
diff --git a/Makefile b/Makefile
index af931ed..a4f36f1 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ bot_phone_number ?= $(shell cat config.yaml | yq '.communication_service.phone_n
app_url ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["appUrl"].value')
blob_storage_public_name ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["blobStoragePublicName"].value')
communication_id ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["communicationId"].value')
+log_analytics_workspace_customer_id ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["logAnalyticsWorkspaceName"].value')
version:
@bash ./cicd/version/version.sh -g . -c
@@ -148,6 +149,13 @@ logs:
--resource-group $(name) \
--tail 100
+logs-history:
+ az monitor log-analytics query \
+ --analytics-query "ContainerAppConsoleLogs_CL | project TimeGenerated, Log_s | sort by TimeGenerated desc" \
+ --output jsonc \
+ --timespan P1D \
+ --workspace $(log_analytics_workspace_customer_id)
+
eventgrid-register:
@echo "⚙️ Deleting previous event grid subscription..."
az eventgrid event-subscription delete --name $(name) || true
diff --git a/bicep/app.bicep b/bicep/app.bicep
index fdd0951..aa7c314 100644
--- a/bicep/app.bicep
+++ b/bicep/app.bicep
@@ -93,6 +93,7 @@ var config = {
output appUrl string = appUrl
output blobStoragePublicName string = storageAccount.name
output communicationId string = communication.id
+output logAnalyticsWorkspaceCustomerId string = logAnalyticsWorkspace.properties.customerId
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: prefix
diff --git a/bicep/main.bicep b/bicep/main.bicep
index b5d9dc3..91512d1 100644
--- a/bicep/main.bicep
+++ b/bicep/main.bicep
@@ -21,6 +21,7 @@ targetScope = 'subscription'
output appUrl string = app.outputs.appUrl
output blobStoragePublicName string = app.outputs.blobStoragePublicName
output communicationId string = app.outputs.communicationId
+output logAnalyticsWorkspaceCustomerId string = app.outputs.logAnalyticsWorkspaceCustomerId
var tags = {
application: 'claim-ai'