Skip to content

Commit 5badec7

Browse files
committed
ui
Signed-off-by: Piotr Karpala <[email protected]>
1 parent 1289c50 commit 5badec7

File tree

2 files changed

+247
-2
lines changed

2 files changed

+247
-2
lines changed

DEPLOYMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ Application will use a pre-built docker image hosted in GitHub registry: `ghcr.i
3636
3737
1. **Option 1 - Using a Personal Access Token in the Backend**:
3838

39-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-token%2Fazuredeploy.json)
39+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-token%2Fazuredeploy.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-token%2Fportal.json)
4040

4141
2. **Option 2 - Using GitHub App Registration and GitHub Authentication**:
4242

4343
When using this method, [register your app in Github first](#github-app-registration).
4444

45-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-app-registration%2Fazuredeploy.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Ffeature%2Fportal%2Fazure-deploy%2Fwith-app-registration%2Fportal.json)
45+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-app-registration%2Fazuredeploy.json/uiFormDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2Fgithub-copilot-resources%2Fcopilot-metrics-viewer%2Fmain%2Fazure-deploy%2Fwith-app-registration%2Fportal.json)
4646

4747
**Important**: After deploying Option 2, the redirect URI needs to be updated with the URL of the deployed container app.
4848

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2021-09-09/uiFormDefinition.schema.json",
3+
"view": {
4+
"kind": "Form",
5+
"properties": {
6+
"title": "Copilot Metrics Viewer deployment",
7+
"steps": [
8+
{
9+
"name": "basics",
10+
"label": "Basics",
11+
"elements": [
12+
{
13+
"name": "resourceScope",
14+
"type": "Microsoft.Common.ResourceScope",
15+
"location": {
16+
"resourceTypes": [
17+
"microsoft.resources/resourcegroups"
18+
]
19+
}
20+
},
21+
{
22+
"name": "basicsDescriptionTextBlock",
23+
"type": "Microsoft.Common.TextBlock",
24+
"options": {
25+
"text": "Copilot Metrics Viewer allows users to view usage metrics for GitHub copilot. The application is deployed without authentication, any user who can access the app can view the metrics.",
26+
"link": {
27+
"label": "https://aka.ms/missionlz",
28+
"uri": "https://aka.ms/missionlz"
29+
}
30+
}
31+
},
32+
{
33+
"name": "name",
34+
"type": "Microsoft.Common.TextBox",
35+
"label": "Name",
36+
"subLabel": "",
37+
"defaultValue": "copilot-metrics",
38+
"toolTip": "",
39+
"constraints": {
40+
"required": false,
41+
"regex": "",
42+
"validationMessage": "",
43+
"validations": []
44+
},
45+
"infoMessages": [],
46+
"visible": true
47+
},
48+
{
49+
"name": "location",
50+
"type": "Microsoft.Common.TextBox",
51+
"label": "Location",
52+
"subLabel": "",
53+
"defaultValue": "[[resourceGroup().location]",
54+
"toolTip": "The Azure Container App Location",
55+
"constraints": {
56+
"required": false,
57+
"regex": "",
58+
"validationMessage": "",
59+
"validations": []
60+
},
61+
"infoMessages": [],
62+
"visible": true
63+
},
64+
{
65+
"name": "ghAppSection",
66+
"label": "GitHub Application details",
67+
"type": "Microsoft.Common.Section",
68+
"elements": [
69+
{
70+
"name": "infoBoxLocation",
71+
"type": "Microsoft.Common.InfoBox",
72+
"options": {
73+
"text": "Follow documentation to create GitHub App registration https://github.com/github-copilot-resources/copilot-metrics-viewer/blob/main/DEPLOYMENT.md#github-app-registration",
74+
"style": "Info"
75+
}
76+
},
77+
{
78+
"name": "github-client-id",
79+
"type": "Microsoft.Common.PasswordBox",
80+
"label": {
81+
"password": "github-client-id",
82+
"confirmPassword": "Confirm client id"
83+
},
84+
"defaultValue": "",
85+
"toolTip": "GitHub Client ID from App Installation",
86+
"constraints": {
87+
"required": true,
88+
"regex": "",
89+
"validationMessage": "",
90+
"validations": []
91+
},
92+
"options": {
93+
"hideConfirmation": true
94+
},
95+
"visible": true
96+
},
97+
{
98+
"name": "github-client-secret",
99+
"type": "Microsoft.Common.PasswordBox",
100+
"label": {
101+
"password": "github-client-secret",
102+
"confirmPassword": "Confirm client secret"
103+
},
104+
"defaultValue": "",
105+
"toolTip": "GitHub Client Secret (key) from App Registration",
106+
"constraints": {
107+
"required": true,
108+
"regex": "",
109+
"validationMessage": "",
110+
"validations": []
111+
},
112+
"options": {
113+
"hideConfirmation": true
114+
},
115+
"visible": true
116+
}
117+
]
118+
},
119+
{
120+
"name": "ghSection",
121+
"label": "GitHub Configuration",
122+
"type": "Microsoft.Common.Section",
123+
"elements": [
124+
{
125+
"name": "scope",
126+
"type": "Microsoft.Common.DropDown",
127+
"label": "Select the scope of the application",
128+
"toolTip": "Organization or Enterprise.",
129+
"placeholder": "",
130+
"multiselect": false,
131+
"selectAll": false,
132+
"multiLine": false,
133+
"constraints": {
134+
"allowedValues": [
135+
{
136+
"value": "org",
137+
"label": "Organization"
138+
},
139+
{
140+
"value": "ent",
141+
"label": "Enterprise"
142+
}
143+
]
144+
}
145+
},
146+
{
147+
"name": "github-organization",
148+
"type": "Microsoft.Common.TextBox",
149+
"label": "Github organization slug",
150+
"subLabel": "",
151+
"defaultValue": "",
152+
"toolTip": "GitHub Organization - provide only if application-scope is organization",
153+
"constraints": {
154+
"required": "[equals(steps('basics').ghSection.scope, 'org')]"
155+
},
156+
"infoMessages": [],
157+
"visible": "[equals(steps('basics').ghSection.scope, 'org')]"
158+
},
159+
{
160+
"name": "github-enterprise",
161+
"type": "Microsoft.Common.TextBox",
162+
"label": "Github enterprise slug",
163+
"subLabel": "",
164+
"defaultValue": "",
165+
"toolTip": "GitHub Enterprise - provide only if application-scope is enterprise",
166+
"constraints": {
167+
"required": "[equals(steps('basics').ghSection.scope, 'ent')]"
168+
},
169+
"visible": "[equals(steps('basics').ghSection.scope, 'ent')]"
170+
}
171+
]
172+
},
173+
{
174+
"name": "dockerSection",
175+
"label": "Docker Image",
176+
"type": "Microsoft.Common.Section",
177+
"elements": [
178+
{
179+
"name": "metrics-viewer-docker-image",
180+
"type": "Microsoft.Common.TextBox",
181+
"label": "Metrics-viewer-docker-image",
182+
"subLabel": "",
183+
"defaultValue": "ghcr.io/github-copilot-resources/copilot-metrics-viewer-with-proxy:latest",
184+
"toolTip": "Docker image for metrics viewer - use default or replace with your own",
185+
"constraints": {
186+
"required": false,
187+
"validations": []
188+
},
189+
"infoMessages": [],
190+
"visible": true
191+
}
192+
]
193+
},
194+
{
195+
"name": "networkSection",
196+
"label": "Networking",
197+
"type": "Microsoft.Common.Section",
198+
"elements": [
199+
{
200+
"name": "infoBoxLocation",
201+
"type": "Microsoft.Common.InfoBox",
202+
"options": {
203+
"text": "Without a subnet the application is going to be publicly available",
204+
"style": "Warning"
205+
}
206+
},
207+
{
208+
"name": "subnetId",
209+
"type": "Microsoft.Common.TextBox",
210+
"label": "Subnet Id",
211+
"subLabel": "",
212+
"defaultValue": "",
213+
"toolTip": "Subnet ID (at least /23) for the managed environment when deploying app without public access",
214+
"constraints": {
215+
"required": false,
216+
"regex": "",
217+
"validationMessage": "",
218+
"validations": []
219+
},
220+
"infoMessages": [],
221+
"visible": true
222+
}
223+
]
224+
}
225+
]
226+
}
227+
]
228+
},
229+
"outputs": {
230+
"kind": "ResourceGroup",
231+
"location": "[steps('basics').resourceScope.location.name]",
232+
"resourceGroupId": "[steps('basics').resourceScope.resourceGroup.id]",
233+
"parameters": {
234+
"name": "[steps('basics').name]",
235+
"location": "[steps('basics').location]",
236+
"github-client-id": "[steps('basics').ghAppSection.github-client-id]",
237+
"github-client-secret": "[steps('basics').ghAppSection.github-client-secret]",
238+
"github-organization": "[steps('basics').ghSection.github-organization]",
239+
"github-enterprise": "[steps('basics').ghSection.github-enterprise]",
240+
"metrics-viewer-docker-image": "[steps('basics').dockerSection.metrics-viewer-docker-image]",
241+
"subnetId": "[steps('basics').networkSection.subnetId]"
242+
}
243+
}
244+
}
245+
}

0 commit comments

Comments
 (0)