I am trying to create a context of Azure API management through scripts. The scripts I have I am able to execute the inbulit powershell terminal in Azure portal. But I am trying to run that scripts through my pipeline. currents pipeline runs under ubuntu, here is the yaml task. I have tried with enable core as well as without it.
steps:
- task: AzurePowerShell@5
displayName: 'Azure PowerShell script: InlineScript'
inputs:
azureSubscription: '<sc>'
ScriptType: InlineScript
Inline: |
Set-AzContext -SubscriptionId $(subId)
$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "$(rgName)" -ServiceName "$(serviceName)"
pipeline throws standard error -
The term 'New-AzureRmApiManagementContext' is not recognized
| as a name of a cmdlet, function, script file, or executable
| program. Check the spelling of the name, or if a path was
| included, verify that the path is correct and try again.
Is there something I need to import while running this?