Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Insights cant be turned off when using Azure Container Apps #2281

Open
solrac149 opened this issue Jan 16, 2025 · 9 comments
Open

App Insights cant be turned off when using Azure Container Apps #2281

solrac149 opened this issue Jan 16, 2025 · 9 comments
Assignees

Comments

@solrac149
Copy link

Free Tier is broken

Issue
The origin/main branch fails to deploy, last tested on commit a967edf. No change to any files. Deploying to a personal Azure account with no custom configurations, no other deployments or apps. That is, attempting to deploy an unmodified, factory version of this project to a barebones personal Azure account

Environment Setup
The following commands were run to set the free tier:

azd auth login
azd env new

azd env set AZURE_APP_SERVICE_SKU F1
azd env set AZURE_SEARCH_SERVICE_SKU free
azd env set AZURE_DOCUMENTINTELLIGENCE_SKU F0
azd env set USE_LOCAL_PDF_PARSER true
azd env set USE_LOCAL_HTML_PARSER true
azd env set AZURE_COSMOSDB_SKU free
azd env set AZURE_USE_APPLICATION_INSIGHTS false
azd env set USE_VECTORS false

azd up

PROBLEM TRIGGER
The line azd env set AZURE_USE_APPLICATION_INSIGHTS false is what causes the failed deployment. By removing this environment variable, the application deploys successfully.

ERROR OUTPUT

Deployment template validation failed: 'The template resource 'test-aca-env' at line '1' and column '14704' is not valid: The language expression property array index '2' is out of bounds. Please see https://aka.ms/arm-functions for usage details” 

TemplateViolation 
LineNumber: 1 
linePosition: 14704 
path: properties.template.resources.managedEnvironment

EXPECTED BEHAVIOR / SOLUTION
It should be possible to disable Application Insights, an optional, paid monitoring product, and deploy the fully zero-cost configuration of the demo.

@pamelafox
Copy link
Collaborator

Did you also change azure.yaml to deploy to app service?

@pamelafox
Copy link
Collaborator

I did replicate this issue with container apps deployment, by the way. It's related to a known issue with Bicep for container apps. I'm trying to see if there's a workaround.

For App Service deployment, you also need to change azure.yaml, as we can't switch to appservice with only env variables, unfortunately.

@solrac149
Copy link
Author

Did you also change azure.yaml to deploy to app service?

I did not attempt deploying the app service version. That is commented out on the main branch 🙂

@solrac149
Copy link
Author

I did replicate this issue with container apps deployment, by the way. It's related to a known issue with Bicep for container apps. I'm trying to see if there's a workaround.

For App Service deployment, you also need to change azure.yaml, as we can't switch to appservice with only env variables, unfortunately.

Great news, good to know! Thanks so much. The container app seems to load lightning fast compared to the app service version a couple of months ago. What are the pros and cons of each?

@pamelafox
Copy link
Collaborator

As you observe, containerapps is a much faster deployment, which is why we now default to it.

The disadvantages of ACA:

  • Container apps only just added private endpoint support, so we don't yet support it in the repo. I started a branch for it yesterday so we hoped to have that Bicep merged in the next few weeks.
  • Container apps doesn't have a truly free tier - since container apps is consumption based pricing, and the container registry is hourly pricing. It's still very cheap, at $5 a month for low traffic ACA + registry, but it's not an actual free tier like app service.

I think I know how to get container apps working without analytics, I'll try it later today.

@pamelafox
Copy link
Collaborator

I have yet to come up with a good workaround for container apps with no analytics, am discussing with some teams.

@solrac149
Copy link
Author

The disadvantages of ACA:
...
I think I know how to get container apps working without analytics, I'll try it later today.

Thanks so much for this comparison info! And as well for working on the analytics conflict. Your support is truly appreciated

@solrac149
Copy link
Author

@pamelafox also, in the readme, in the low cost section, where it says:

Turn off Azure Monitor (Application Insights):

azd env set AZURE_USE_APPLICATION_INSIGHTS false

Application Insights is quite inexpensive already, so turning this off may not be worth the costs saved, but it is an option for those who want to minimize costs.

Please add a highlighted note stating that application insights must be turned on if container apps is active

Thanks!

@pamelafox
Copy link
Collaborator

@solrac149 Adding a note here:
#2300

Please comment if you have suggested wording improvements.

The Log Analytics costs is $0.00 for my test apps, so it should be very low cost for a trial deployment, assuming low users.

@pamelafox pamelafox self-assigned this Jan 23, 2025
@pamelafox pamelafox changed the title Azure Deployment — Free Tier is broken! App Insights cant be turned off when using Azure Container Apps Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants