Azure Plugins for Porter
This is a set of Azure plugins for Porter.
Install
The plugin is distributed as a single binary, azure
. The following snippet will clone this repository, build the binary
and install it to ~/.porter/plugins/.
go get get.porter.sh/plugin/azure/cmd/azure
cd $(go env GOPATH)/src/get.porter.sh/plugin/azure
make build install
After installing the plugin, you must modify your porter configuration file and select which plugin you want to use.
Storage
Storage plugins allow Porter to store data, such as claims, parameters and credentials, in Azure's cloud.
Blob
The azure.blob
plugin stores data in Azure Blob Storage.
-
Open, or create, ~/.porter/config.toml
.
-
Add the following line to activate the Azure blob storage plugin:
default-storage-plugin = "azure.blob"
-
Create a storage account
-
Create a container named porter
.
-
Copy the connection string for the storage account. Then set it as an environment variable named
AZURE_STORAGE_CONNECTION_STRING
.
Secrets
Secrets plugins allow Porter to inject secrets into credential or parameter sets.
For example, if your team has a shared key vault with a database password, you
can use the keyvault plugin to inject it as a credential or parameter when you install a bundle.
Key Vault
The azure.keyvault
plugin resolves credentials or parameters against secrets in Azure Key Vault.
-
Open, or create, ~/.porter/config.toml
-
Add the following lines to activate the Azure keyvault secrets plugin:
default-secrets = "mysecrets"
[[secrets]]
name = "mysecrets"
plugin = "azure.keyvault"
[secrets.config]
vault = "myvault"
-
Create a key vault and set the vault name in the config with name of the vault.
-
Create a service principal and create an Access Policy on the vault giving Get and List secret permissions.
-
Using credentials for the service principal set the environment variables: AZURE_TENANT_ID
,AZURE_CLIENT_ID
, and AZURE_CLIENT_SECRET
.