File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2323 # App OID
2424 SP_APP_OID=$(az ad sp show --id "$servicePrincipalId" | jq -rc '.id')
2525 # Get Subscription ID.
26- #SC_DATA_JSON=$(az devops service-endpoint list --organization msazure --project One | \
27- # jq -rc --arg SP_APP_OID "$SP_APP_OID" \
28- # '[ .[] | { name: .name, data: .data } | select((.serviceEndpointReferences | length) > 0) | select(.data.appObjectId == $SP_APP_OID) ][0]')
2926 SUBSCRIPTION_ID=$(az account show | jq -rc '.id')
3027
3128 # Get Pipeline Build Subscriptions.
4744 az group create \
4845 --name "$RG_NAME" \
4946 --location "$ACNCI_SA_LOCATION" \
50- --tags Pipelines.CreatedBy="$servicePrincipalId" Pipelines.DefinitionID="$SYSTEM_DEFINITIONID"
47+ --tags "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" \
48+ "$ACNCI_BUILDTAG_CREATEDBYBUILDID"="$BUILD_BUILDID" \
49+ "$ACNCI_BUILDTAG_CREATEDBYAPPID"="$servicePrincipalId"
5150 # Storage Blob Data Contributor on RG
5251 RG_ID="/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RG_NAME}"
5352 az role assignment create \
Original file line number Diff line number Diff line change @@ -30,12 +30,15 @@ steps:
3030 R_QUERY="[? type == 'Microsoft.Storage/storageAccounts' && resourceGroup == '$RG_NAME']"
3131 az resource list \
3232 --query "$R_QUERY" \
33- --tag "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" -o json
33+ --tag "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" \
34+ --tag "$ACNCI_BUILDTAG_CREATEDBYAPPID"="$servicePrincipalId" -o json
3435 echo $R_QUERY
36+
3537 # JSON of Returned Results
3638 R_LIST=$(az resource list \
3739 --query "$R_QUERY" \
38- --tag "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" -o json)
40+ --tag "$ACNCI_BUILDTAG_DEFINITIONID"="$SYSTEM_DEFINITIONID" \
41+ --tag "$ACNCI_BUILDTAG_CREATEDBYAPPID"="$servicePrincipalId" -o json)
3942 echo $R_LIST
4043 # Length of resource list
4144 R_LIST_LENGTH=$(echo "$R_LIST" | jq length)
You can’t perform that action at this time.
0 commit comments