-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateUIDefinition.json
More file actions
250 lines (250 loc) · 10.1 KB
/
CreateUIDefinition.json
File metadata and controls
250 lines (250 loc) · 10.1 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "location",
"type": "Microsoft.Common.TextBox",
"label": "Location",
"defaultValue": "global",
"toolTip": "Resources location",
"visible": false
}
],
"steps": [
{
"name": "integrationConfig",
"type": "Microsoft.Common.Section",
"label": "Integration Configuration",
"elements": [
{
"name": "fireflySite",
"type": "Microsoft.Common.DropDown",
"label": "Firefly Site",
"defaultValue": "US",
"toolTip": "The Firefly site for your organization. Choose EU if your Firefly account is hosted in the European region.",
"constraints": {
"allowedValues": [
{
"label": "US",
"value": "firefly.ai"
},
{
"label": "EU",
"value": "eu.firefly.ai"
}
],
"required": true
},
"visible": true
},
{
"name": "directoryDomain",
"type": "Microsoft.Common.TextBox",
"label": "Directory Domain",
"toolTip": "Enter the directory domain for Firefly integration (e.g., yourcompany.com).",
"placeholder": "yourcompany.com",
"constraints": {
"required": true,
"regex": "^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$",
"validationMessage": "Please enter a valid domain name (e.g., example.com)"
},
"visible": true
},
{
"name": "isProd",
"type": "Microsoft.Common.CheckBox",
"label": "Production Environment",
"toolTip": "Check if this is a production environment.",
"constraints": {
"required": false
},
"visible": true
},
{
"name": "enforceStorageNetworkRules",
"type": "Microsoft.Common.CheckBox",
"label": "Enforce Storage Network Rules",
"toolTip": "Restrict storage account access to Firefly IP addresses only. When enabled, the storage account will only allow access from predefined Firefly IP addresses.",
"constraints": {
"required": false
},
"visible": true
},
{
"name": "tags",
"type": "Microsoft.Common.EditableGrid",
"ariaLabel": "Custom tags for resources",
"label": "Tags",
"toolTip": "Add custom tags for your resources. A 'firefly: true' tag will be automatically added.",
"constraints": {
"width": "Full",
"rows": {
"count": {
"min": 0,
"max": 20
}
},
"columns": [
{
"id": "tagName",
"header": "Tag Name",
"width": "1fr",
"element": {
"type": "Microsoft.Common.TextBox",
"placeholder": "Environment",
"constraints": {
"required": true,
"regex": "^[a-zA-Z0-9_-]+$",
"validationMessage": "Tag name must contain only letters, numbers, underscores, and hyphens"
}
}
},
{
"id": "tagValue",
"header": "Tag Value",
"width": "1fr",
"element": {
"type": "Microsoft.Common.TextBox",
"placeholder": "Production",
"constraints": {
"required": true,
"regex": "^[\\w\\s\\-./:@()]+$",
"validationMessage": "Tag value may include letters, numbers, spaces, underscore (_), hyphen (-), dot (.), slash (/), colon (:), at (@), and parentheses"
}
}
}
]
},
"visible": true
},
{
"name": "targetSubscriptions",
"type": "Microsoft.Common.DropDown",
"label": "Target Subscriptions",
"placeholder": "Select subscriptions to monitor",
"toolTip": "Select the subscriptions where you want to deploy Firefly monitoring infrastructure. Multi-subscription deployment will create the same monitoring infrastructure (storage account, event grid, diagnostic settings) in each selected subscription.",
"constraints": {
"allowedValues": "[map(steps('integrationConfig').subscriptionApi.value, (item) => parse(concat('{\"label\":\"', item.displayName, ' (', item.subscriptionId, ')\",\"value\":\"', item.subscriptionId, '\"}')))]",
"required": true
},
"visible": true,
"multiselect": true
},
{
"name": "subscriptionApi",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "GET",
"path": "/subscriptions?api-version=2020-01-01"
},
"visible": false
}
]
},
{
"name": "servicePrincipal",
"label": "Service Principal",
"elements": [
{
"name": "createAppReg",
"type": "Microsoft.Common.Section",
"label": "Create Firefly Azure Integration",
"elements": [
{
"name": "infoBox",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "The following steps involve creating or selecting a service principal for Firefly to access your Azure subscription. Please read them carefully before continuing.\n\n1. Select the option to create a new app registration, and click 'Change Selection'.\n2. Give it a name (e.g., 'Firefly-Integration') and select any account type.\n3. Click 'Register'. This will open a new page to create a client secret.\n4. Click '+ New Client Secret' to add a Client Secret.\n5. Copy the Value of the Client Secret.\n6. Click the close (X) button in the top-right corner to return to this template screen.\n7. Paste the value of the Client Secret in the corresponding field on this template.\n\nAfter deployment, this service principal will be granted the following permissions on the selected subscription:\n• Reader\n• Billing Reader\n• App Configuration Data Reader\n• Security Reader"
}
},
{
"name": "ServicePrincipal",
"type": "Microsoft.Common.ServicePrincipalSelector",
"label": {
"servicePrincipalId": "Service Principal Id",
"password": "Client Secret",
"sectionHeader": "Service Principal"
},
"toolTip": {
"servicePrincipalId": "Service Principal for Firefly integration"
},
"defaultValue": {
"principalId": "<default guid>",
"name": "(New) default App Id"
},
"constraints": {
"required": true,
"validationMessage": "Must be a valid client secret"
},
"options": {
"hideCertificate": true
},
"visible": true
}
],
"visible": true
}
]
},
{
"name": "fireflyCredentials",
"label": "Firefly Credentials",
"elements": [
{
"name": "ffAccessKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Firefly Access Key",
"confirmPassword": "Re-enter Firefly Access Key"
},
"toolTip": "Enter your Firefly Access Key.",
"constraints": {
"required": true,
"regex": "^.+$",
"validationMessage": "Firefly Access Key is required"
},
"options": {
"hideConfirmation": true
}
},
{
"name": "ffSecretKey",
"type": "Microsoft.Common.PasswordBox",
"label": {
"password": "Firefly Secret Key",
"confirmPassword": "Re-enter Firefly Secret Key"
},
"toolTip": "Enter your Firefly Secret Key.",
"constraints": {
"required": true,
"regex": "^.+$",
"validationMessage": "Firefly Secret Key is required"
},
"options": {
"hideConfirmation": true
}
}
]
}
],
"outputs": {
"location": "[location()]",
"servicePrincipalClientId": "[steps('servicePrincipal').createAppReg.ServicePrincipal.appId]",
"servicePrincipalObjectId": "[first(steps('servicePrincipal').createAppReg.ServicePrincipal.objectId)]",
"servicePrincipalClientSecret": "[steps('servicePrincipal').createAppReg.ServicePrincipal.password]",
"fireflyAccessKey": "[steps('fireflyCredentials').ffAccessKey]",
"fireflySecretKey": "[steps('fireflyCredentials').ffSecretKey]",
"fireflySite": "[steps('integrationConfig').fireflySite]",
"directoryDomain": "[steps('integrationConfig').directoryDomain]",
"isProd": "[steps('integrationConfig').isProd]",
"targetSubscriptions": "[steps('integrationConfig').targetSubscriptions]",
"enforceStorageNetworkRules": "[steps('integrationConfig').enforceStorageNetworkRules]",
"tags": "[steps('integrationConfig').tags]"
}
}
}