forked from jongio/chat-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure.yaml
51 lines (50 loc) · 1.68 KB
/
azure.yaml
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
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
name: chat-copilot
metadata:
template: [email protected]
services:
api:
project: ./webapi
host: appservice
language: dotnet
web:
project: ./webapp
host: staticwebapp
language: ts
dist: build
hooks:
predeploy:
posix:
shell: sh
run: node entrypoint.cjs -o ./build/env-config.js
continueOnError: false
interactive: true
windows:
shell: pwsh
run: node entrypoint.cjs -o ./build/env-config.js
continueOnError: false
interactive: true
postdeploy:
windows:
shell: pwsh
run: |
if ($env:FRONTEND_CLIENTID -ne '') {
$objectId = (az ad app show --id $env:FRONTEND_CLIENTID | ConvertFrom-Json).id
$redirectUris = (az rest --method GET --uri "https://graph.microsoft.com/v1.0/applications/$objectId" --headers 'Content-Type=application/json' | ConvertFrom-Json).spa.redirectUris
$body = "{spa:{redirectUris:["
foreach ($uri in $redirectUris) { $body += "'$uri',"}
$body += ("'$env:REACT_APP_WEB_BASE_URL'" + "]}}")
az rest --method PATCH --uri "https://graph.microsoft.com/v1.0/applications/$objectId" --headers 'Content-Type=application/json' --body $body
}
# searcherplugin:
# project: ./plugins/web-searcher
# host: appservice
# language: dotnet
memorypipeline:
project: ./memorypipeline
host: appservice
language: dotnet
hooks:
prepackage:
shell: pwsh
run: npm config set legacy-peer-deps true