From 9d1775bde24fdf24822fff171a99311c45590c6f Mon Sep 17 00:00:00 2001 From: Krzysiek Madejski Date: Fri, 1 Feb 2019 16:08:54 +0100 Subject: [PATCH] Created Deploy: Azure (markdown) --- Deploy:-Azure.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Deploy:-Azure.md diff --git a/Deploy:-Azure.md b/Deploy:-Azure.md new file mode 100644 index 0000000..f6d1f12 --- /dev/null +++ b/Deploy:-Azure.md @@ -0,0 +1,53 @@ +Note: Do you know that [non-profits can access US $3500 in Azure credits](https://www.microsoft.com/en-us/nonprofits/azure) to set up cloud solutions? + +## Step 1: Create Resource Group + +You can easily do it in the [portal](https://portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.Resources%2Fsubscriptions%2FresourceGroups). + +## Step 2: Configuration + +The question is how do you want to keep your Matterbridge configuration. + +### Method 1: Static config file on Storage Account +The easiest method is probably to create a [Storage Account](https://portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.Storage%2FStorageAccounts) with a file share and upload there your `matterbridge.toml`. + +### Method 2: Versioned configuration on Github +To manage and make it transparent what channels get bridged you might want to keep the configuration versioned on Github and provide tokens via environment variables. + +Example: [config file](https://github.com/Code-for-All/matterbridge-config/blob/master/matterbridge.toml) and [env variables](https://github.com/Code-for-All/matterbridge-config/blob/master/template.env). + +## Step 3: Create container instance + +Sadly mounting volumes (Github or Storage Account) is not available from Portal so you have to use the CLI (there is CLI icon in the top menu). + +For Github-backed config type: +``` +az container create \ + --resource-group matterbridge \ + --name matterbridge-container \ + --image 42wim/matterbridge:1.13.0 \ + --os-type Linux \ + --restart-policy OnFailure \ + --command-line "/bin/matterbridge -conf /home/config/matterbridge.toml" \ + --gitrepo-url https://github.com/Code-for-All/matterbridge-config \ + --gitrepo-mount-path /home/config \ + --environment-variables 'MATTERBRIDGE_SLACK_CODEFORALL_TOKEN'='xoxb-' 'MATTERBRIDGE_SLACK_EPANSTWO_TOKEN'='xoxb-' +``` +Docs: [Github params](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-gitrepo) + + +For file-share-backed config type: +``` +az container create \ + --resource-group matterbridge \ + --name matterbridge-container \ + --image 42wim/matterbridge:1.13.0 \ + --os-type Linux \ + --restart-policy OnFailure \ + --command-line "/bin/matterbridge -conf /home/config/matterbridge.toml" \ + --azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME \ + --azure-file-volume-account-key $STORAGE_KEY \ + --azure-file-volume-share-name $ACI_PERS_SHARE_NAME \ + --azure-file-volume-mount-path /home/config +``` +[Check here](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files) how to find the file share keys. \ No newline at end of file