Azure log alert rule created successfully with ARM template but not appearing in portal
up vote
0
down vote
favorite
I have created a few ARM templates for deploying Azure metric alert rules, but I now have a requirement to deploy a log alert rule (i.e. a rule based on an Application Insights query rather than a platform metric).
I have scripted the template following the example here (which suggests I need to create a resource of type Microsoft.Insights/scheduledQueryRules
) and deployed using Azure portal's Template Deployment service as described here.
Azure reports the deployment as successful, and the activity log gives me the deployment result, including the ID of my new resource e.g. /subscriptions/[subscription-id]/resourcegroups/[alerts-resource-group]/providers/Microsoft.Insights/scheduledQueryRules/Custom errors spike alert
.
However, when I navigate to the Monitor blade in subscription [subscription-id], and filter down by resource group [alerts-resource-group] I don't see my new alert.
As a sanity check I created a metric alert using the same process targeting the same App Insights resource, and this one does show up in the Monitor blade.
I guess my question is, am I misunderstanding something about log-based alert rules? For example, does an Azure 'resource' of type Microsoft.Insights/scheduledQueryRules
equate with alert rules of signal type Log Search in Monitor / Alerts / Manage alert rules? I'm confident my template is correct because it passes validation and completed successfully. But I'm baffled about where the alert rule is ending up!
One thing I should mention is that I'm creating the alert rule in a different resource group to the App Insights instance itself, but this is also true of the metric alert so assumed this wasn't significant.
azure azure-devops arm-template
add a comment |
up vote
0
down vote
favorite
I have created a few ARM templates for deploying Azure metric alert rules, but I now have a requirement to deploy a log alert rule (i.e. a rule based on an Application Insights query rather than a platform metric).
I have scripted the template following the example here (which suggests I need to create a resource of type Microsoft.Insights/scheduledQueryRules
) and deployed using Azure portal's Template Deployment service as described here.
Azure reports the deployment as successful, and the activity log gives me the deployment result, including the ID of my new resource e.g. /subscriptions/[subscription-id]/resourcegroups/[alerts-resource-group]/providers/Microsoft.Insights/scheduledQueryRules/Custom errors spike alert
.
However, when I navigate to the Monitor blade in subscription [subscription-id], and filter down by resource group [alerts-resource-group] I don't see my new alert.
As a sanity check I created a metric alert using the same process targeting the same App Insights resource, and this one does show up in the Monitor blade.
I guess my question is, am I misunderstanding something about log-based alert rules? For example, does an Azure 'resource' of type Microsoft.Insights/scheduledQueryRules
equate with alert rules of signal type Log Search in Monitor / Alerts / Manage alert rules? I'm confident my template is correct because it passes validation and completed successfully. But I'm baffled about where the alert rule is ending up!
One thing I should mention is that I'm creating the alert rule in a different resource group to the App Insights instance itself, but this is also true of the metric alert so assumed this wasn't significant.
azure azure-devops arm-template
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have created a few ARM templates for deploying Azure metric alert rules, but I now have a requirement to deploy a log alert rule (i.e. a rule based on an Application Insights query rather than a platform metric).
I have scripted the template following the example here (which suggests I need to create a resource of type Microsoft.Insights/scheduledQueryRules
) and deployed using Azure portal's Template Deployment service as described here.
Azure reports the deployment as successful, and the activity log gives me the deployment result, including the ID of my new resource e.g. /subscriptions/[subscription-id]/resourcegroups/[alerts-resource-group]/providers/Microsoft.Insights/scheduledQueryRules/Custom errors spike alert
.
However, when I navigate to the Monitor blade in subscription [subscription-id], and filter down by resource group [alerts-resource-group] I don't see my new alert.
As a sanity check I created a metric alert using the same process targeting the same App Insights resource, and this one does show up in the Monitor blade.
I guess my question is, am I misunderstanding something about log-based alert rules? For example, does an Azure 'resource' of type Microsoft.Insights/scheduledQueryRules
equate with alert rules of signal type Log Search in Monitor / Alerts / Manage alert rules? I'm confident my template is correct because it passes validation and completed successfully. But I'm baffled about where the alert rule is ending up!
One thing I should mention is that I'm creating the alert rule in a different resource group to the App Insights instance itself, but this is also true of the metric alert so assumed this wasn't significant.
azure azure-devops arm-template
I have created a few ARM templates for deploying Azure metric alert rules, but I now have a requirement to deploy a log alert rule (i.e. a rule based on an Application Insights query rather than a platform metric).
I have scripted the template following the example here (which suggests I need to create a resource of type Microsoft.Insights/scheduledQueryRules
) and deployed using Azure portal's Template Deployment service as described here.
Azure reports the deployment as successful, and the activity log gives me the deployment result, including the ID of my new resource e.g. /subscriptions/[subscription-id]/resourcegroups/[alerts-resource-group]/providers/Microsoft.Insights/scheduledQueryRules/Custom errors spike alert
.
However, when I navigate to the Monitor blade in subscription [subscription-id], and filter down by resource group [alerts-resource-group] I don't see my new alert.
As a sanity check I created a metric alert using the same process targeting the same App Insights resource, and this one does show up in the Monitor blade.
I guess my question is, am I misunderstanding something about log-based alert rules? For example, does an Azure 'resource' of type Microsoft.Insights/scheduledQueryRules
equate with alert rules of signal type Log Search in Monitor / Alerts / Manage alert rules? I'm confident my template is correct because it passes validation and completed successfully. But I'm baffled about where the alert rule is ending up!
One thing I should mention is that I'm creating the alert rule in a different resource group to the App Insights instance itself, but this is also true of the metric alert so assumed this wasn't significant.
azure azure-devops arm-template
azure azure-devops arm-template
edited Nov 19 at 17:21
asked Nov 19 at 17:04
getsetcode
1,61311331
1,61311331
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
It turns out log alerts require a hidden link to the resource they're monitoring. Otherwise they get created but not listed anywhere in the portal.
In my case I added the following variable to the template:
"linkToAiResource" : "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsResourceName')))]"
Then included this as a tag in the resource definition like this:
"tags": {
"[variables('linkToAiResource')]": "Resource"
}
Once redeployed the alert rule appears in the portal's Monitor blade.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
It turns out log alerts require a hidden link to the resource they're monitoring. Otherwise they get created but not listed anywhere in the portal.
In my case I added the following variable to the template:
"linkToAiResource" : "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsResourceName')))]"
Then included this as a tag in the resource definition like this:
"tags": {
"[variables('linkToAiResource')]": "Resource"
}
Once redeployed the alert rule appears in the portal's Monitor blade.
add a comment |
up vote
0
down vote
accepted
It turns out log alerts require a hidden link to the resource they're monitoring. Otherwise they get created but not listed anywhere in the portal.
In my case I added the following variable to the template:
"linkToAiResource" : "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsResourceName')))]"
Then included this as a tag in the resource definition like this:
"tags": {
"[variables('linkToAiResource')]": "Resource"
}
Once redeployed the alert rule appears in the portal's Monitor blade.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
It turns out log alerts require a hidden link to the resource they're monitoring. Otherwise they get created but not listed anywhere in the portal.
In my case I added the following variable to the template:
"linkToAiResource" : "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsResourceName')))]"
Then included this as a tag in the resource definition like this:
"tags": {
"[variables('linkToAiResource')]": "Resource"
}
Once redeployed the alert rule appears in the portal's Monitor blade.
It turns out log alerts require a hidden link to the resource they're monitoring. Otherwise they get created but not listed anywhere in the portal.
In my case I added the following variable to the template:
"linkToAiResource" : "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appInsightsResourceName')))]"
Then included this as a tag in the resource definition like this:
"tags": {
"[variables('linkToAiResource')]": "Resource"
}
Once redeployed the alert rule appears in the portal's Monitor blade.
answered Nov 22 at 9:48
getsetcode
1,61311331
1,61311331
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379479%2fazure-log-alert-rule-created-successfully-with-arm-template-but-not-appearing-in%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown