user42012
user42012

Reputation: 852

Availability Test in Application Insights atuomatically disables

We have a very simple Application Insights Availability Test (That hits an HTTPS URL across 4 US regions) (basically it hits our App Service). What we have observed it this Availability test automatically stops (not a fixed scheduled) but it abruptly stops and then what we have to do is go back to Availability test Edit the Test and Save it again so that it restarts. This is really weird as we have checked the Activity log also and nothing is reported in it about someone stopping the Test, etc.

Any help on how this can be tackled? As abrupt stoppage of Availability Test (Tests getting grayed out) is really serious as we wont know if there is any outage untill someone reports back on the service.

Upvotes: 2

Views: 412

Answers (1)

ZakiMa
ZakiMa

Reputation: 6241

The behavior was caused by two issues and should not be wide spread:

  1. Issue with ARM Template
  2. A possible bug on App Insights Availability configs

This is interesting corner case, caused by a bug in ARM template and discrepancy between how our Front and Back ends handled it. In provided ARM template there were two tags defined:

"tag": "[concat('hidden-link:/subscriptions/',subscription().id,'/resourceGroups/',resourceGroup().name,'/providers/microsoft.insights/components/',parameters('appInsightsName'))]",
"linkToAiResource": "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsName')))]",

  "tags": {
    "[variables('tag')]": "Resource",
    "[variables('linkToAiResource')]": "Resource"
  },

These two tags instantiated into this:

"hidden-link:/subscriptions//subscriptions/xxx/resourceGroups/yyy/providers/microsoft.insights/components/zzz": "Resource",
"hidden-link:/subscriptions/xxx/resourceGroups/yyy/providers/microsoft.insights/components/zzz": "Resource"

Note, we have duplicated “/subscriptions/” in the first tag. So, two issues:

  1. There were two such links in the first place
  2. The first of them is invalid (I guess subscription().id already includes “/subscriptions/” part).

The fix should be straightforward – just leave the second tag (we validated that it starts working).

Now, the bug on our side is that the logic of how this case is handled differs between Front and Back ends:

  1. Front end successfully finds a valid “Resource” hidden-link (ignoring invalid one)
  2. Back end (I guess) uses the first one, finds that it points to (apparently) deleted resource and marks this test as deleted as well. This results in stopping this test

We will adjust the logic. Either will start failing at Front End and will change Back End to use the same logic (fix will be rolled some time in Jan).

Upvotes: 2

Related Questions