-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathtask.json
141 lines (141 loc) · 6.52 KB
/
task.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{
"id": "1d876d40-9aa7-11e7-905d-f541cc882994",
"name": "AzureMonitorAlerts",
"friendlyName": "Azure Monitor alerts (Deprecated)",
"description": "Configure alerts on available metrics for an Azure resource (Deprecated)",
"author": "Microsoft Corporation",
"helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-monitor-alerts",
"helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?linkid=859947)",
"category": "Deploy",
"visibility": [
"Build",
"Release"
],
"version": {
"Major": 0,
"Minor": 198,
"Patch": 0
},
"minimumAgentVersion": "2.111.0",
"instanceNameFormat": "Configure Azure Alerts : $(ResourceName)",
"groups": [
{
"name": "NotifyViaEmail",
"displayName": "Notify via email",
"isExpanded": false
}
],
"inputs": [
{
"name": "ConnectedServiceName",
"aliases": [
"azureSubscription"
],
"type": "connectedService:AzureRM",
"label": "Azure Subscription",
"required": true,
"helpMarkDown": "Select the Azure Resource Manager subscription. \n\nNote: To configure new service connection, select the Azure subscription from the list and click 'Authorize'. \n\nIf your subscription is not listed or if you want to use an existing Service Principal, you can setup an Azure service connection using 'Add' or 'Manage' button."
},
{
"name": "ResourceGroupName",
"type": "pickList",
"label": "Resource Group",
"required": true,
"properties": {
"EditableOptions": true
},
"helpMarkDown": "Select the Azure Resource Group that contains the Azure resource where you want to configure an alert."
},
{
"name": "ResourceType",
"type": "pickList",
"label": "Resource Type",
"defaultValue": "Microsoft.Insights/components",
"options": {
"Microsoft.Insights/components": "Application Insights",
"Microsoft.Web/sites": "App Services",
"Microsoft.Storage/storageAccounts": "Storage Account",
"Microsoft.Compute/virtualMachines": "Virtual Machines"
},
"required": true,
"helpMarkDown": "Select the Azure resource type."
},
{
"name": "ResourceName",
"type": "pickList",
"label": "Resource name",
"required": true,
"helpMarkDown": "Select name of Azure resource where you want to configure an alert."
},
{
"name": "AlertRules",
"type": "multiLine",
"label": "Alert rules",
"required": true,
"helpMarkDown": "List of Azure monitor alerts configured on selected Azure resource. \n\nTo add or modify alerts, click on […] button.",
"properties": {
"resizable": "true",
"rows": 5,
"editorExtension": "ms.vss-services-azure.azure-monitor-alerts-view",
"displayFormat": "{{#rules}}{{{metric.displayValue}}} {{{thresholdCondition}}} {{{thresholdValue}}} {{{metric.unit}}}\n{{/rules}}"
}
},
{
"name": "NotifyServiceOwners",
"type": "boolean",
"label": "Subscription owners, contributors and readers",
"required": false,
"helpMarkDown": "Send email notification to everyone who has access to this resource group.",
"groupName": "NotifyViaEmail"
},
{
"name": "NotifyEmails",
"type": "string",
"label": "Additional administrator emails",
"required": false,
"helpMarkDown": "Add additional email addresses separated by semicolons(;) if you want to send email notification to additional people (whether or not you checked the \"subscription owners...\" box).",
"groupName": "NotifyViaEmail",
"validation": {
"expression": "isMatch(value, '^\\s*(([^;\\s]+@[^;\\s]+\\.[^;\\s]+)(\\s*;\\s*|\\s*$))*$','IgnoreCase')",
"message": "Enter valid email addresses separated by semicolons"
}
}
],
"execution": {
"Node": {
"target": "azuremonitoralerts.js"
}
},
"dataSourceBindings": [
{
"target": "ResourceGroupName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureResourceGroups"
},
{
"target": "ResourceName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMResourcesInRGBasedOnType",
"parameters": {
"ResourceGroupName": "$(ResourceGroupName)",
"ResourceType": "$(ResourceType)"
},
"resultTemplate": "{ \"Value\" : \"{{{name}}}\", \"DisplayValue\" : \"{{{name}}}\" }"
}
],
"messages": {
"ProcessingRule": "Processing rule : '%s'",
"AlertRuleCheck": "Checking if alert rule '%s' exists in the resource group '%s'.",
"AlertRuleTargetResourceIdMismatchError": "Alert rule with name '%s' is already configured to monitor a different resource with ID '%s'. Please select a different alert rule name.",
"AlertRuleExists": "Alert rule '%s' already exists in the resource group '%s'. Updating the alert rule.",
"AlertRuleDoesNotExist": "Alert rule '%s' does not exist in the resource group '%s'. Creating a new alert rule.",
"CreatedRule": "Created rule : '%s'",
"UpdatedRule": "Updated rule : '%s'",
"Couldnotfetchaccesstoken": "Could not fetch access token for Azure. Status Code: %s (%s) %s.",
"SPNExpiredCheck": "Check if the SPN is valid and not expired.",
"FailedToGetAzureMetricAlerts": "Failed to get Application Insights Alert rule: %s. Error: %s",
"FailedToUpdateAzureMetricAlerts": "Failed to update Azure metric alert rule '%s' Resource. Error: %s",
"ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.",
"DeprecatedTask": "As part of classic alerts retirement, we are deprecating the Azure Monitor Alerts task which is currently based on classic alerts API. Please use the Azure CLI task to manage new alerts. Refer this: https://aka.ms/deprecateazuremonitoralertstask"
}
}