Azure file share backups - kwantu/platformconfiguration GitHub Wiki
Using Azure as a file share backup
sudo yum install cifs-utils
Add the azure cli
echo -e "[azure-cli]
name=Azure CLI
baseurl=https://packages.microsoft.com/yumrepos/azure-cli
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/azure-cli.repo
Install the azure-cli
sudo yum install azure-cli
Now prepare the connection
- make a directory /opt/azure to hold things
mkdir /opt/azure
- Open port 445 for the communication with azure
firewall-cmd --add-port=445/tcp --permanent
firewall-cmd --reload
- Login to get the codes needed to connect to azure
az login
>> that returns the following
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CZYF7NJ6F to authenticate.
after authentication it returns something similar to this:
[
{
"cloudName": "AzureCloud",
"homeTenantId": "5e38b8a2-23af-4aa4-87eb-c167a72abb1e",
"id": "616f2032-85c2-420b-b89e-10fae449f6ab",
"isDefault": true,
"managedByTenants": [],
"name": "Free Trial",
"state": "Enabled",
"tenantId": "5e38b8a2-23af-4aa4-87eb-c167a72abb1e",
"user": {
"name": "[email protected]",
"type": "user"
}
},
{
"cloudName": "AzureCloud",
"homeTenantId": "5e38b8a2-23af-4aa4-87eb-c167a72abb1e",
"id": "87a2017e-294a-47ea-8c02-1e99b157b3dc",
"isDefault": false,
"managedByTenants": [],
"name": "Azure subscription 1",
"state": "Enabled",
"tenantId": "5e38b8a2-23af-4aa4-87eb-c167a72abb1e",
"user": {
"name": "[email protected]",
"type": "user"
}
}
]
Prepare the file share in azure
- Log in to Azure
- Go to the Storage account, and create a new fileshare
- Open the fileshare, and select the Connect option. Select Linux and copy the mount script
- Paste the mount script in /opt/azure/mountAsure.sh, and run it. The file share will now be visibile.