Giter VIP home page Giter VIP logo

azure-cli-orb's Introduction

Azure CLI Orb CircleCI status CircleCI Orb Version GitHub license CircleCI Community

A CircleCI Orb to install and log into the Azure CLI

Features

This orb offers the ability to login via an Azure user both on its default tenant and an alternative tenant. It also offers the ability to login via an Azure Service Principal.

Executors

default

Debian-based circleci/python Docker image to use

Parameters
Parameter type default
python-version string 2.7
debian-release string stretch

azure-docker

Microsoft's Azure CLI Docker image:

docker:
  - image: mcr.microsoft.com/azure-cli

Commands

You may use the following commands provided by this orb directly from your own job.

install

Example
version: 2.1

orbs:
  azure-cli: circleci/[email protected]

jobs:
  verify-install:
    executor: azure-cli/default
    steps:
      - azure-cli/install

      - run:
          name: Verify Azure CLI is installed
          command: az -v

workflows:
  example-workflow:
    jobs:
      - verify-install

login-with-user

Parameters
Parameter type default description
azure-username env_var_name AZURE_USERNAME Environment variable storing your Azure username
azure-password env_var_name AZURE_PASSWORD Environment variable storing your Azure password
alternate-tenant boolean false Set to True to use the --tenant az login option
azure-tenant env_var_name AZURE_TENANT Environment variable storing your Azure tenant, necessary if alternate-tenant is set to true
Example
version: 2.1

orbs:
  azure-cli: circleci/[email protected]

jobs:
  login-to-azure:
    executor: azure-cli/default
    steps:
      - azure-cli/install

      - azure-cli/login-with-user:
          alternate-tenant: true

      - run:
          name: List resources of tenant stored as `AZURE_TENANT` env var
          command: az resource list

workflows:
  example-workflow:
    jobs:
      - login-to-azure

login-with-service-principal

Parameters
Parameter type default description
azure-sp env_var_name AZURE_SP Name of environment variable storing the full name of the Service Principal, in the form http://app-url
azure-sp-password env_var_name AZURE_SP_PASSWORD Name of environment variable storing the password for the Service Principal
azure-sp-tenant env_var_name AZURE_SP_TENANT Name of environment variable storing the tenant ID for the Service Principal
Example
version: 2.1

orbs:
  azure-cli: circleci/[email protected]

jobs:
  login-to-azure:
    executor: azure-cli/azure-docker
    steps:
      - azure-cli/login-with-service-principal

      - run:
          name: List resources of tenant stored as `AZURE_SP_TENANT` env var
          command: az resource list

workflows:
  example-workflow:
    jobs:
      - login-to-azure

login-with-user-or-service-principal

Parameters
Parameter type default description
azure-username env_var_name AZURE_USERNAME Environment variable storing your Azure username. Only applicable for user logins.
azure-password env_var_name AZURE_PASSWORD Environment variable storing your Azure password. Only applicable for user logins.
alternate-tenant boolean false Set to True to use the --tenant az login option. Only applicable for user logins.
azure-tenant env_var_name AZURE_TENANT Environment variable storing your Azure tenant, necessary if alternate-tenant is set to true. Only applicable for user logins.
azure-sp env_var_name AZURE_SP Name of environment variable storing the full name of the Service Principal, in the form http://app-url. Only applicable for Service Principal logins.
azure-sp-password env_var_name AZURE_SP_PASSWORD Name of environment variable storing the password for the Service Principal. Only applicable for Service Principal logins.
azure-sp-tenant env_var_name AZURE_SP_TENANT Name of environment variable storing the tenant ID for the Service Principal. Only applicable for Service Principal logins.
Example
description: >
  Log into Azure with the login type determined based on
  environment variable detection.

usage:
  version: 2.1

  orbs:
    azure-cli: circleci/[email protected]

  jobs:
    login-to-azure:
      executor: azure-cli/azure-docker
      steps:
        - azure-cli/login-with-user-or-service-principal

        - run:
            name: List resources of tenant stored as `AZURE_SP_TENANT` env var
            command: az resource list

  workflows:
    example-workflow:
      jobs:
        - login-to-azure

azure-cli-orb's People

Contributors

iynere avatar lokst avatar mislavcimpersak avatar ganezasan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.