posh-providers/azure/az
Kevin Franklin Kim 4588a19b45
feat: add schema
2025-04-04 16:44:08 +02:00
..
artifactory.go feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00
az.go feat(pulumi): add pulumi azure integration 2024-01-17 09:24:21 +01:00
cluster.go feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00
command.go feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00
config_test.go feat: add schema 2025-04-04 16:44:08 +02:00
config.go feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00
config.schema.json feat: add schema 2025-04-04 16:44:08 +02:00
README.md feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00
subscription.go feat(azure/az): add artifactory command 2025-03-20 16:08:27 +01:00

POSH az provider

Usage

This provider requires az to be installed on your system.

Plugin

package main

type Plugin struct {
  l        log.Logger
  az        *az.AZ
  cache    cache.Cache
  kubectl  *kubectl.Kubectl
  commands command.Commands
}

func New(l log.Logger) (plugin.Plugin, error) {
  var err error
  inst := &Plugin{
    l:        l,
    cache:    &cache.MemoryCache{},
    commands: command.Commands{},
  }

  // ...

  inst.kubectl, err = kubectl.New(l, inst.cache)
  if err != nil {
    return nil, errors.Wrap(err, "failed to create kubectl")
  }

  inst.az, err = az.New(l, inst.cache)
  if err != nil {
    return nil, errors.Wrap(err, "failed to create az")
  }

  // ...

  inst.commands.Add(az.NewCommand(l, inst.az, inst.kubectl))

  // ...

  return inst, nil
}

Config

## az
az:
  configPath: .posh/config/azure
  subscriptions:
    production:
      name: my-subscription
      clusters:
        default:
          name: aks-my-prod
      artifactories:
        default:
          name: acr-my-prod

Ownbrew

To install binary locally, add:

ownbrew:
  packages:
    ## https://github.com/Azure/kubelogin/releases
    - name: kubelogin
      tap: foomo/tap/azure/kubelogin
      version: 0.1.0