Skip to content

Commit cb538a2

Browse files
Update how-to-create-configure-projects.md
converted bash commands to powershell
1 parent 33c483b commit cb538a2

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

articles/deployment-environments/how-to-create-configure-projects.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ To create a project in your dev center:
5858
1. Retrieve dev center resource ID:
5959

6060
```azurecli
61-
DEVCID=$(az devcenter admin devcenter show -n <devcenterName> --query id -o tsv)
62-
echo $DEVCID
61+
$DEVCID = az devcenter admin devcenter show -n <devcenterName> --query id -o tsv
62+
Write-Output $DEVCID
6363
```
6464
6565
1. Create project in dev center:
6666
6767
```azurecli
68-
az devcenter admin project create -n <projectName> \
69-
--description "My first project." \
68+
az devcenter admin project create -n <projectName> `
69+
--description "My first project." `
7070
--dev-center-id $DEVCID
7171
```
7272
@@ -85,22 +85,22 @@ In this quickstart, you assign the Owner role to the system-assigned managed ide
8585
1. Retrieve Subscription ID:
8686
8787
```azurecli
88-
SUBID=$(az account show --name <subscriptionName> --query id -o tsv)
89-
echo $SUBID
88+
$SUBID = az account show --name <subscriptionName> --query id -o tsv
89+
Write-Output $SUBID
9090
```
9191
9292
1. Retrieve the Object ID of the dev center's identity using the name of the dev center resource:
9393
9494
```azurecli
95-
OID=$(az ad sp list --display-name <devcenterName> --query [].id -o tsv)
96-
echo $OID
95+
$OID = az ad sp list --display-name <devcenterName> --query [].id -o tsv
96+
Write-Output $OID
9797
```
9898
9999
1. Assign the role of Owner to the dev center on the subscription:
100100
101101
```azurecli
102-
az role assignment create --assignee $OID \
103-
--role "Owner" \
102+
az role assignment create --assignee $OID `
103+
--role "Owner" `
104104
--scope "/subscriptions/$SUBID"
105105
```
106106
@@ -114,8 +114,8 @@ To configure a project, add a [project environment type](how-to-configure-projec
114114
# Remove group default scope for next command. Leave blank for group.
115115
az configure --defaults group=
116116
117-
ROID=$(az role definition list -n "Owner" --scope /subscriptions/$SUBID --query [].name -o tsv)
118-
echo $ROID
117+
$ROID = az role definition list -n "Owner" --scope /subscriptions/$SUBID --query [].name -o tsv
118+
Write-Output $ROID
119119
120120
# Set default resource group again
121121
az configure --defaults group=<resourceGroupName>
@@ -130,12 +130,14 @@ To configure a project, add a [project environment type](how-to-configure-projec
130130
1. Choose an environment type and create it for the project:
131131
132132
```azurecli
133-
az devcenter admin project-environment-type create -n <availableEnvironmentType> \
134-
--project <projectName> \
135-
--identity-type "SystemAssigned" \
136-
--roles "{\"${ROID}\":{}}" \
137-
--deployment-target-id "/subscriptions/${SUBID}" \
138-
--status Enabled
133+
$roles = "{`"$($ROID)`":{}}"
134+
az devcenter admin project-environment-type create `
135+
-n <availableEnvironmentType> `
136+
--project <projectName> `
137+
--identity-type "SystemAssigned" `
138+
--roles $roles `
139+
--deployment-target-id "/subscriptions/$SUBID" `
140+
--status Enabled
139141
```
140142
141143
> [!NOTE]
@@ -148,23 +150,23 @@ In this quickstart, you give access to your own ID. Optionally, you can replace
148150
1. Retrieve your own Object ID:
149151
150152
```azurecli
151-
MYOID=$(az ad signed-in-user show --query id -o tsv)
152-
echo $MYOID
153+
$MYOID = az ad signed-in-user show --query id -o tsv
154+
Write-Output $MYOID
153155
```
154156
155157
1. Assign admin access:
156158
157159
```azurecli
158-
az role assignment create --assignee $MYOID \
159-
--role "DevCenter Project Admin" \
160+
az role assignment create --assignee $MYOID `
161+
--role "DevCenter Project Admin" `
160162
--scope "/subscriptions/$SUBID"
161163
```
162164
163165
1. Optionally, you can assign the Dev Environment User role:
164166
165167
```azurecli
166-
az role assignment create --assignee $MYOID \
167-
--role "Deployment Environments User" \
168+
az role assignment create --assignee $MYOID `
169+
--role "Deployment Environments User" `
168170
--scope "/subscriptions/$SUBID"
169171
```
170172

0 commit comments

Comments
 (0)