Skip to content

Commit

Permalink
Integration: Ensure Windows CI Azure CLI version matches agent.
Browse files Browse the repository at this point in the history
In the Windows CI's periodic runs the `azure/CLI` GitHub action library
is leveraged to run various Azure-related commands.

To avoid possible desyncing between the auth libraries of `azure/CLI` and
the actual CLI executable on the CI job runner as described
[here](Azure/cli#56 (comment)),
this patch configures `azure/CLI` to always auto-detect and use the CLI
version found on the job runner.

Signed-off-by: Nashwan Azhari <[email protected]>
  • Loading branch information
aznashwan committed Nov 19, 2021
1 parent db9c6fc commit 8be67cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/windows-periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,28 @@ jobs:
- name: AZResourceGroupCreate
uses: azure/CLI@v1
with:
azcliversion: 2.29.2
azcliversion: agentazcliversion
inlinescript: |
az group create -n ${{ matrix.AZURE_RESOURCE_GROUP }} -l ${{ env.AZURE_DEFAULT_LOCATION }} --tags creationTimestamp=$(date +%Y-%m-%dT%T%z)
- name: AZTestVMCreate
uses: azure/CLI@v1
with:
azcliversion: 2.29.2
azcliversion: agentazcliversion
inlinescript: |
az vm create -n winTestVM --admin-username ${{ env.DEFAULT_ADMIN_USERNAME }} --admin-password ${{ env.PASSWORD }} --image ${{ matrix.AZURE_IMG }} -g ${{ matrix.AZURE_RESOURCE_GROUP }} --nsg-rule SSH --size ${{ env.AZURE_DEFAULT_VM_SIZE }}
- name: GetAZVMPublicIP
uses: azure/CLI@v1
with:
azcliversion: 2.29.2
azcliversion: agentazcliversion
inlinescript: |
echo "VM_PUB_IP=$(az network public-ip list -g ${{ matrix.AZURE_RESOURCE_GROUP }} | jq '.[0]["ipAddress"]' | tr -d '\"')" >> $GITHUB_ENV
- name: EnableAZVMSSH
uses: azure/CLI@v1
with:
azcliversion: 2.29.2
azcliversion: agentazcliversion
inlinescript: |
az vm run-command invoke --command-id RunPowerShellScript -n winTestVM -g ${{ matrix.AZURE_RESOURCE_GROUP }} --scripts @$GITHUB_WORKSPACE/script/setup/enable_ssh_windows.ps1 --parameters 'SSHPublicKey=${{ env.SSH_PUB_KEY }}'
Expand Down Expand Up @@ -205,6 +205,6 @@ jobs:
- name: ResourceCleanup
uses: azure/CLI@v1
with:
azcliversion: 2.29.2
azcliversion: agentazcliversion
inlinescript: |
az group delete -g ${{ matrix.AZURE_RESOURCE_GROUP }} --yes

0 comments on commit 8be67cc

Please sign in to comment.