I am very confused with how to pass arguments to inline script (Powershell task or Azure Cli task) in yaml pipeline. Can somebody explain in simple language with a simple example? I have seen so many articles about passing arguments to Powershell script (.ps1) but not to an inline script. My inline script below is disassociate and Associate a new NSG to an existing subnet:
- task: AzureCLI@2
inputs:
azureSubscription: 'JMeterAzureConnection'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: |
$oldnsgid=az network nsg show -n armmc-nsg -g arm-armmcdemo-rg --query 'subnets[].id' -o tsv
az network vnet subnet update --ids $oldnsgid --network-security-group "armmc-nsgv1"
When I run this, I get the below error during the pipeline run:
ERROR: argument --ids: expected at least one argument
Can you please help me what I need to do with this above issue?