jenkinsci / azure-cli-plugin

A Jenkins plugin to use Azure CLI for managing Azure resources.
https://plugins.jenkins.io/azure-cli/
MIT License
5 stars 18 forks source link

Open and close az CLI session automatically #2

Open madkroll opened 6 years ago

madkroll commented 6 years ago

Hi,

This would be useful from my perspective to support new construction which opens and closes az CLI session automatically for a block of commands (not only az commands)

The reality is that all scripts in my project are in bash files - and that would be cool if such a plugin can open the session before calling these scripts - and close it after. As I understand there is no such option at the moment and this plugin supports only az cli commands.

Sample:

withAzureCLI('servicePrincipalId') {
// az cli session is already opened
// any commands with calls to az CLI inside, including custom shell scripts
// az cli session will be closed automatically as soon as this block ends
}