File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ infra:
14
14
bicep : ./infra/main.bicep
15
15
hooks :
16
16
preprovision :
17
- shell : pwsh
18
- continueOnError : false
19
- interactive : true
20
- run : ./infra/azd-hooks/preprovision.ps1
17
+ posix :
18
+ shell : sh
19
+ continueOnError : false
20
+ interactive : false
21
+ run : ./infra/azd-hooks/preprovision.sh
22
+ windows :
23
+ shell : pwsh
24
+ continueOnError : false
25
+ interactive : false
26
+ run : ./infra/azd-hooks/preprovision.ps1
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Running preprovision.sh..."
4
+
5
+ # Get the user principal name of the signed-in user and write it to the .env file for the azd environment
6
+ echo " Fetching User Principal Name and setting PRINCIPAL_NAME environment variable..."
7
+ PRINCIPAL_NAME=$( az ad signed-in-user show --query ' userPrincipalName' -o tsv)
8
+ azd env set " PRINCIPAL_NAME" " $PRINCIPAL_NAME "
9
+ echo " PRINCIPAL_NAME: $PRINCIPAL_NAME "
10
+
11
+ # Get the client IP address and write it to the .env file for the azd environment
12
+ echo " Fetching Client IP address and setting CLIENT_IP_ADDRESS environment variable..."
13
+ CLIENT_IP_ADDRESS=$( curl -s https://api.ipify.org)
14
+ azd env set " CLIENT_IP_ADDRESS" " $CLIENT_IP_ADDRESS "
15
+ echo " CLIENT_IP_ADDRESS: $CLIENT_IP_ADDRESS "
You can’t perform that action at this time.
0 commit comments