Last active
November 19, 2022 06:32
-
-
Save geralexgr/8114105fa3c359a247ce75981626d74f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: none | |
pr: none | |
parameters: | |
- name: vms | |
type: object | |
default: ["ubuntu1","windows-1"] | |
pool: | |
vmImage: ubuntu-latest | |
jobs: | |
- job: startvmjob | |
displayName: Start VMs | |
steps: | |
- checkout: none | |
- ${{ each vm in parameters.vms }}: | |
- task: AzureCLI@2 | |
displayName: starting vm ${{vm}} | |
inputs: | |
azureSubscription: 'Azure Subscription Service Connection' | |
scriptType: 'pscore' | |
scriptLocation: 'inlineScript' | |
inlineScript: | | |
$vmrequest = az vm list | ConvertFrom-Json | Where-Object {$_.Name -Match "${{vm}}"} | |
az vm start --resource-group $vmrequest.resourcegroup --name $vmrequest.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment