2

I am getting this error starting this weekend for Azure East US 2 region. This may also be happening in other regions that I am not aware of.

The code was logging to appinsights last week.

Non-retryable server side error 404: {"itemsReceived":12,"itemsAccepted":0,"errors":[{"index":0,"statusCode":404,"message":"Ingestion is allowed only from stamp specific endpoint - Location: https://eastus2-3.in.applicationinsights.azure.com/v2.1/track","location":"https://eastus2-3.in.applicationinsights.azure.com/v2.1/track","cacheControl":"max-age=604800"},{"index":1,"status ....

Code:

import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
logger = logging.getLogger(__name__)

logger.addHandler(AzureLogHandler(
    connection_string='InstrumentationKey=672e7b1f-......')
)

logger.warning("This is a logger warning")

UPDATE: Putting full connection string fixed the issue. Still this breaking change seems like unreliable, and sudden (over the weekend the code which was working fine, has stopped working).

I am happy that I DID NOT USED AppInsights yet for software shipped to customer site.

UPDATE 3 hrs later: Apparently, something changed on Azure and things have started working again without placing full connection string. (Thank you, Microsoft). We will accelerate the connection string change now, but without panic.

S2L
  • 1,746
  • 1
  • 16
  • 20

1 Answers1

2

Try using a connection string instead of instrumentation key.

Apparently, "new" regions require ConnectionString for ingestion.

On March 31st, 2025, support for instrumentation key ingestion will end. Instrumentation key ingestion will continue to work, but we’ll no longer provide updates or support for the feature. Transition to connection strings to take advantage of new capabilities.

See:

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Thanks. I got the same info from a colleague. But why the change this sudden weekend? According to MS docs, connection string will be enforced starting 2025. – S2L Apr 25 '22 at 15:05
  • 1
    @S2L: You happened to encounter the problem this weekend. You'll notice the user in the first link encountered the problem *LAST JANUARY* (in a West German region). It sounds like instrumentation keys might become problematic for *ANY* region... – paulsm4 Apr 25 '22 at 15:13
  • Yep -- doesn't align with 2025 statement from MSFT, but I understand your point. A system to provide reliability has unreliable updates and communication. – S2L Apr 25 '22 at 15:16