While working through the instructor-led / Skillable Agent Builder setup, I encountered an issue with the generated foundry/agent-builder/src/.env.
Following the documented setup:
cd foundry/agent-builder/scripts
./setenv.sh
the generated value for:
APPLICATIONINSIGHTS_CONNECTION_STRING=
contained additional text before the expected:
Removing the unexpected prefix so that the value began directly with InstrumentationKey= resolved the downstream error.
The current Agent Builder scripts/setenv.sh retrieves the value using:
az monitor app-insights component show \
--app "$APPINSIGHTS_NAME" \
--resource-group "$RESOURCE_GROUP" \
--query connectionString \
-o tsv
and then writes the returned stdout directly into .env without validating it.
Interestingly, the Cohere workshop in the same repository retrieves the same connection string using the core Azure resource command:
az resource show \
--resource-group "$RESOURCE_GROUP" \
--name "$APP_INSIGHTS_NAME" \
--resource-type "Microsoft.Insights/components" \
--query properties.ConnectionString \
--output tsv
Using the latter approach in Agent Builder would also avoid depending on the application-insights Azure CLI extension during the Skillable setenv.sh path.
Potential improvements:
- Retrieve the connection string with
az resource show, consistent with the Cohere setup.
- Validate that a non-empty returned value begins with
InstrumentationKey=.
- Avoid silently accepting malformed CLI output into the generated
.env.
I no longer have access to the temporary Skillable Azure environment, so I cannot currently reproduce the exact Azure CLI output that preceded InstrumentationKey= or perform an end-to-end test of the change. The malformed generated .env and the successful manual correction were observed during the live workshop environment.
While working through the instructor-led / Skillable Agent Builder setup, I encountered an issue with the generated
foundry/agent-builder/src/.env.Following the documented setup:
cd foundry/agent-builder/scripts ./setenv.shthe generated value for:
contained additional text before the expected:
Removing the unexpected prefix so that the value began directly with
InstrumentationKey=resolved the downstream error.The current Agent Builder
scripts/setenv.shretrieves the value using:and then writes the returned stdout directly into
.envwithout validating it.Interestingly, the Cohere workshop in the same repository retrieves the same connection string using the core Azure resource command:
Using the latter approach in Agent Builder would also avoid depending on the
application-insightsAzure CLI extension during the Skillablesetenv.shpath.Potential improvements:
az resource show, consistent with the Cohere setup.InstrumentationKey=..env.I no longer have access to the temporary Skillable Azure environment, so I cannot currently reproduce the exact Azure CLI output that preceded
InstrumentationKey=or perform an end-to-end test of the change. The malformed generated.envand the successful manual correction were observed during the live workshop environment.