Skip to content

Commit

Permalink
fix aca bicep (#267)
Browse files Browse the repository at this point in the history
* fix reqs file

* fix env for aca bicep
  • Loading branch information
cassiebreviu authored Nov 14, 2024
1 parent 4b8548f commit 1cdfdec
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 32 deletions.
19 changes: 18 additions & 1 deletion infra/app/api.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
param name string
param location string = resourceGroup().location
param tags object = {}

param subscriptionId string
param azureAiProjectName string
param identityName string
param identityId string
param containerAppsEnvironmentName string
Expand Down Expand Up @@ -43,6 +44,22 @@ module app '../core/host/container-app-upsert.bicep' = {
name: 'AZURE_CLIENT_ID'
value: identityId
}
{
name: 'AZURE_LOCATION'
value: location
}
{
name: 'AZURE_SUBSCRIPTION_ID'
value: subscriptionId
}
{
name: 'AZURE_RESOURCE_GROUP'
value: resourceGroup().name
}
{
name: 'AZURE_AI_PROJECT_NAME'
value: azureAiProjectName
}
{
name: 'AZURE_SEARCH_ENDPOINT'
value: aiSearchEndpoint
Expand Down
2 changes: 2 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ module apiContainerApp 'app/api.bicep' = {
appinsights_Connectionstring: ai.outputs.applicationInsightsConnectionString
bingApiEndpoint: bing.outputs.endpoint
bingApiKey: bing.outputs.bingApiKey
subscriptionId: subscription().subscriptionId
azureAiProjectName: ai.outputs.projectName
}
}

Expand Down
58 changes: 29 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# fastapi
# fastapi[standard]
# openai
# requests
# prompty[azure]==0.1.24
# promptflow
# azure-ai-evaluation
# pandas
# opentelemetry-instrumentation-fastapi
# jsonlines
# python-dotenv==1.0.1
# azure-search-documents==11.4.0
# gunicorn==21.2.0
# jupyter
# opentelemetry-sdk
# opentelemetry-instrumentation
# azure-identity==1.17.1
# https://remoteevalbugbash.blob.core.windows.net/remoteevalbugbash/azure_ai_project-1.0.0b1-py3-none-any.whl
# gunicorn==21.2.0
# azure-keyvault-secrets
# aiohttp==3.9.5
# azure-cognitiveservices-speech==1.37.0
# nbconvert
# azure-ai-evaluation[remote]
# validators
# azureml-mlflow
# azure-monitor-opentelemetry
# opentelemetry-instrumentation-openai-v2
azure-ai-inference[opentelemetry]
fastapi
fastapi[standard]
openai
requests
prompty[azure]==0.1.24
promptflow
azure-ai-evaluation
pandas
opentelemetry-instrumentation-fastapi
jsonlines
python-dotenv==1.0.1
azure-search-documents==11.4.0
gunicorn==21.2.0
jupyter
opentelemetry-sdk
opentelemetry-instrumentation
azure-identity==1.17.1
https://remoteevalbugbash.blob.core.windows.net/remoteevalbugbash/azure_ai_project-1.0.0b1-py3-none-any.whl
gunicorn==21.2.0
azure-keyvault-secrets
aiohttp==3.9.5
azure-cognitiveservices-speech==1.37.0
nbconvert
azure-ai-evaluation[remote]
validators
azureml-mlflow
azure-monitor-opentelemetry
opentelemetry-instrumentation-openai-v2
# azure-ai-inference[opentelemetry]
# azure-ai-inference[opentelemetry] ./packages/whl packages
# azure-ai-projects is not available in PyPI install it from the ./packages/whl packages
./packages/azure_ai_inference-1.0.0b6-py3-none-any.whl
Expand Down
8 changes: 6 additions & 2 deletions src/api/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ def setup_telemetry(app: FastAPI):
local_tracing_enabled=os.getenv("LOCAL_TRACING_ENABLED")
otel_exporter_endpoint = os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT")


location = os.environ["AZURE_LOCATION"]+".api.azureml.ms;"
subscription = os.environ["AZURE_SUBSCRIPTION_ID"]+";"
resource_group = os.environ["AZURE_RESOURCE_GROUP"]+";"
project_name = os.environ["AZURE_AI_PROJECT_NAME"]+";"

# Configure OpenTelemetry using Azure AI Project
ai_project_conn_str = os.getenv("AZURE_LOCATION")+".api.azureml.ms;"+os.getenv("AZURE_SUBSCRIPTION_ID")+";"+os.getenv("AZURE_RESOURCE_GROUP")+";"+os.getenv("AZURE_AI_PROJECT_NAME")
ai_project_conn_str = location + subscription +resource_group + project_name

# Configure OpenTelemetry using Azure AI Project
with AIProjectClient.from_connection_string(
Expand Down

0 comments on commit 1cdfdec

Please sign in to comment.