Created Deploy: Azure (markdown)

Krzysiek Madejski 2019-02-01 16:08:54 +01:00
parent 2600b16e89
commit 9d1775bde2

53
Deploy:-Azure.md Normal file

@ -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.