-
-
Save bkrrajmali/975daa8dcdfa625dabc4797fbb726a80 to your computer and use it in GitHub Desktop.
This file contains hidden or 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