Skip to content

Commit c4dee84

Browse files
committed
Update Managed Identity
1 parent b62b27d commit c4dee84

File tree

3 files changed

+415
-355
lines changed

3 files changed

+415
-355
lines changed

azure.yaml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,42 @@
22

33
name: ContosoDevExp
44

5+
# hooks:
6+
# preprovision:
7+
# shell: sh
8+
# continueOnError: false
9+
# interactive: true
10+
# run: |
11+
# #!/bin/bash
12+
13+
# set -e
14+
# defaultPlatform="github"
15+
16+
# # Add a if statement to check if the environment variable is set
17+
# if [ -z "${SOURCE_CONTROL_PLATFORM}" ]; then
18+
# echo "SOURCE_CONTROL_PLATFORM is not set. Setting it to '${defaultPlatform}' by default."
19+
# export SOURCE_CONTROL_PLATFORM="${SOURCE_CONTROL_PLATFORM:-${defaultPlatform}}"
20+
# else
21+
# echo "Existing SOURCE_CONTROL_PLATFORM is set to '${SOURCE_CONTROL_PLATFORM}'."
22+
# fi
23+
# ./setup.sh -e ${AZURE_ENV_NAME} -s ${SOURCE_CONTROL_PLATFORM}
24+
25+
526
hooks:
627
preprovision:
7-
shell: sh
28+
shell: pwsh
829
continueOnError: false
930
interactive: true
1031
run: |
11-
#!/bin/bash
32+
$ErrorActionPreference = "Stop"
33+
$defaultPlatform = "github"
1234
13-
set -e
14-
defaultPlatform="github"
35+
# Check if the environment variable is set
36+
if ([string]::IsNullOrEmpty($env:SOURCE_CONTROL_PLATFORM)) {
37+
Write-Host "SOURCE_CONTROL_PLATFORM is not set. Setting it to '$defaultPlatform' by default."
38+
$env:SOURCE_CONTROL_PLATFORM = $defaultPlatform
39+
} else {
40+
Write-Host "Existing SOURCE_CONTROL_PLATFORM is set to '$($env:SOURCE_CONTROL_PLATFORM)'."
41+
}
1542
16-
# Add a if statement to check if the environment variable is set
17-
if [ -z "${SOURCE_CONTROL_PLATFORM}" ]; then
18-
echo "SOURCE_CONTROL_PLATFORM is not set. Setting it to '${defaultPlatform}' by default."
19-
export SOURCE_CONTROL_PLATFORM="${SOURCE_CONTROL_PLATFORM:-${defaultPlatform}}"
20-
else
21-
echo "Existing SOURCE_CONTROL_PLATFORM is set to '${SOURCE_CONTROL_PLATFORM}'."
22-
fi
23-
./setup.sh -e ${AZURE_ENV_NAME} -s ${SOURCE_CONTROL_PLATFORM}
43+
.\setup.ps1 -e $env:AZURE_ENV_NAME -s $env:SOURCE_CONTROL_PLATFORM

0 commit comments

Comments
 (0)