Azure CLI task - Upgrade to Modern Shell?
See original GitHub issueIt appears Azure CLI task uses batch/CMD.exe as the shell interpreter.
Can we get this to use something more modern? Powershell? Bash?
Is there some reason cmd.exe/batch was chosen here that makes something like Powershell or Bash not feasible options? I want to add some logic within Azure CLI tasks and having to implement that logic in batch is right up there of putting it in a vbscript.
Alternatively, Is there a (sane) way to get the azure cli and particularly the service principal identity login step into another step? In other words, run the Azure CLI task and then follow it up with a Bash or Powershell task that contains more logic, that ones run through, executes some az cli command.
_
_
EDIT [May 2019]:
On Windows agents, I would suggest using Azure Powershell
(>=4.* version) task instead of Azure CLI
task. It uses the newer Az powershell module (not the legacy AzureRM module, and also not Azure CLI python executable).
You WILL still have to rewrite/re-research your Azure CLI commands into Az Powershell specific language. This change doesn’t buy you much, but Az Powershell supposedly multi-platform, allowing in theory same code on both Windows and Linux agents.
I still very much prefer Azure CLI syntax over the Az Powershell syntax (Az Powershell appears to rely on very long naming of cmdlets):
az webapp deployment list-publishing-profiles -n $WEBAPPNAME-g $RSGROUP
Get-AzWebAppContainerContinuousDeploymentUrl -ResourceGroupName $RSGROUP -Name $WEBAPPNAME
Ultimately, this doesn’t change what issue wants: Azure CLI within Powershell (not AzureRM, not Az Powershell module) END Edit
Issue Analytics
- State:
- Created 6 years ago
- Reactions:23
- Comments:18 (4 by maintainers)
I agree with @pulkitaggarwl . Being forced to use cmd/batch is a severe step in the wrong direction. Ie. building up a blob store sastoken, and using it to download a linked template proves to be very hard (especially if you compare it with how easy it is done in az cli). Please prioritize this feature req 😉
A other workaround is to change the azure cli task to a inline script and write: