GithubHelp home page GithubHelp logo

flcdrg / get-azure-app-configuration-action Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 4.03 MB

GitHub Action to get settings from Azure App Configuration

License: MIT License

TypeScript 100.00%
github-actions azure azure-app-configuration

get-azure-app-configuration-action's Introduction

GitHub Action - Get Azure App Configuration

build-test

A GitHub Action that allows settings to be pulled from an Azure App Configuration store.

It is intended to be analogous to the Azure Pipelines Azure App Configuration task.

With the Get Azure App Configuration action, you can fetch key values from an Azure App Configuration instance and consume them in your GitHub Action workflows.

The definition of this GitHub Action is in action.yml.

Values fetched will be set as outputs of the app configuration action instance and can be consumed in the subsequent actions in the workflow using the notation: ${{ steps.<Id-of-the-AppConfiguration-Action>.outputs.<Secret-Key> }}. In addition, secrets are also set as environment variables. By default, variables are not automatically masked if printed to the console or logs.

Example

- uses: Azure/login@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: flcdrg/get-azure-app-configuration-action@v2
  id: get-app-configuration
  with:
    resourceGroup: ${{ secrets.RESOURCE_GROUP }}
    appConfigurationName: ${{ secrets.APP_CONFIGURATION }}
    keyFilter: 'key1'

- run: echo ${{ steps.get-app-configuration.outputs.key1 }}

Inputs

Various inputs are defined in action.yml to let you configure this action:

Name Description
resourceGroup The name of the resource group that contains the App Configuration resource
appConfigurationName The name of the App Configuration resource
keyFilter See below
labelFilter See below

keyFilter

Filters for keys. There are two types of matching:

  1. Exact matching. Up to 5 key names are allowed, separated by commas (',')
  2. Wildcard matching. A single wildcard expression can be specified.
Value Matches
omitted or * Matches any key
abc Matches a key named abc
abc* Matches key names that start with abc

These characters are reserved and must be prefixed with a backslash to be specified: * or \ or ,

labelFilter

Filters for labels. There are two types of matching:

  1. Exact matching. Up to 5 labels are allowed, separated by commas (',')
  2. Wildcard matching. A single wildcard expression can be specified.
Value Matches
omitted or * Matches any key
%00 Matches any key without a label
prod Matches a key with label named prod
prod* Matches key with label names that start with prod

These characters are reserved and must be prefixed with a backslash in order to be specified: * or \ or ,

Using Azure Key Vault

Azure App Configuration can reference Key Vault secrets. In order for this to work with your GitHub Action, you need to ensure the following:

Other notes

Create a new service principal with contributor access to a resource group.

az ad sp create-for-rbac --name "app-config-action" --role contributor `
                            --scopes /subscriptions/{subscription-id}/resourceGroups/`{resource-group} `
                            --sdk-auth

Find existing service principal

az ad sp list --query "[?displayName == 'app-config-action']"

Renew service principal secret

az ad sp credential reset --id 4715aece-8daf-4a1a-8f0e-e5eddc9bf8de --display-name rbac --years 1

get-azure-app-configuration-action's People

Contributors

dependabot[bot] avatar flcdrg avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

get-azure-app-configuration-action's Issues

Make variables opt-in

Make setting outputs the default, but add configuration option to opt-in for setting keys as environment variables

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.