Skip to content

Commit

Permalink
chore: use msi instead of sp in windows pipeline (#3585)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjiezhang1997 authored Aug 29, 2023
1 parent 2b30384 commit 63538a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pipelines/e2e-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pr:
pool:
# uncomment this if the auto teardown pool is down.
# vmImage: ubuntu-22.04
name: $(1ES_DevInfra_Auto_TearDown_Pool_Name)
name: $(AZURE_POOL_NAME)

parameters:
- name: test2019containerd
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/templates/e2e-windows-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- bash: pip install -Iv azure-cli==2.45.0 --extra-index-url https://azurecliprod.blob.core.windows.net/edge
displayName: use specified version of az cli
- bash: |
az login --service-principal -u $(AZURE_BUILD_CLIENT_ID) -p $(AZURE_BUILD_CLIENT_SECRET) --tenant $(AZURE_BUILD_TENANT_ID)
az login --identity
az account set -s $(AZURE_E2E_SUBSCRIPTION_ID)
displayName: az login
- bash: bash .pipelines/scripts/setup_go.sh
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- bash: pip install -Iv azure-cli==2.45.0 --extra-index-url https://azurecliprod.blob.core.windows.net/edge
displayName: use specified version of az cli
- bash: |
az login --service-principal -u $(AZURE_BUILD_CLIENT_ID) -p $(AZURE_BUILD_CLIENT_SECRET) --tenant $(AZURE_BUILD_TENANT_ID)
az login --identity
az account set -s $(AZURE_E2E_SUBSCRIPTION_ID)
displayName: az login
- bash: |
Expand Down
5 changes: 0 additions & 5 deletions packer.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ endif
endif

az-login:
ifeq (${OS_TYPE},Windows)
@echo "Logging into Azure with service principal..."
@az login --service-principal -u ${CLIENT_ID} -p ${CLIENT_SECRET} --tenant ${TENANT_ID}
else
@echo "Logging into Azure with agent VM MSI..."
@az login --identity
endif
@az account set -s ${SUBSCRIPTION_ID}

init-packer:
Expand Down

0 comments on commit 63538a0

Please sign in to comment.