You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trigger:
none
##################
# Drop Down Menu:-
##################
parameters:
- name: environment
displayName: Select environment
type: string
default: 'dev'
values:
- dev
- test
- uat
- prod
#############
#Variables:-
############
variables:
ServiceConnection: 'amcloud-cicd-service-connection' # Please replace with your Service Connection!
BuildAgent: 'windows-latest' # Please replace with your Build Agent. You can continue to use this as this is Microsoft Hosted Windows Build Agent!
######################
# Declare Build Agent:-
######################
pool:
vmImage: '$(BuildAgent)'
##################################
# Declare Stages:-
# Test Runtime parameters as:-
# 1. Dropdown Menu
##################################
stages:
- stage: Test_Runtime_Parameters_DropDown_Menu
displayName: Test Runtime Parameters Dropdown Menu
jobs:
- job: Test_Runtime_Parameters_DropDown_Menu
steps:
- task: AzureCLI@2
displayName: Test Runtime Parameters Dropdown Menu
inputs:
azureSubscription: '$(ServiceConnection)'
scriptLocation: 'inlineScript'
scriptType: 'ps'
inlineScript: |
echo "Deploying to ${{ parameters.environment }} environment"
CODE BLOCK FOR DROPDOWN MENU AS RUNTIME VARIABLES IN YAML:-
##################
# Drop Down Menu:-
##################
parameters:
- name: environment
displayName: Select environment
type: string
default: 'dev'
values:
- dev
- test
- uat
- prod
OUTPUT: DROPDOWN MENU OPTION AS RUNTIME VARIABLES
1. Dropdown Menu as runtime variables is displayed successfully on Pipeline Execution.
2. Successful Pipeline Execution.
3. SPOT THE DIFFERENCE:-
The "type" of the variable is exactly the same except the no. of values. For "Radio button", we entered 3 values but if we needed "Dropdown Menu", we just increased 1 more value. "Radio button" option changes to "Dropdown Menu".