Start filling out the quick start section (#1248)

## Description

This commit also fixes a couple of other doc "bugs" and creates tab consistency.

## Type of change

- [x] 🌻 Feature
- [x] 🐛 Bugfix
- [x] 🗺️ Documentation
This commit is contained in:
Niraj Tolia 2022-10-20 09:59:49 -07:00 committed by GitHub
parent f57b0f1f7e
commit f78e3ff5bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 174 additions and 15 deletions

View File

@ -1,11 +1,114 @@
# Quick start # Quick start
In this quick start guide, you will perform your first backup followed by a restore. import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import TOCInline from '@theme/TOCInline';
## Prerequisites This quick start guide runs through the steps you can follow to create your first Microsoft 365 backup and restore:
* Configure connection to your M365 Tenant (see [M365 Access](/setup/m365_access)) <TOCInline toc={toc} maxHeadingLevel={2}/>
* Initialize a Corso backup repository (see [Repositories](/setup/repos))
## Connecting to Microsoft 365
Obtaining credentials from Microsoft 365 to allow Corso to run is a moderately involved one-time operation.
Follow the instructions [here](setup/m365_access) to obtain the necessary credentials and then make them available to
Corso.
<Tabs groupId="os">
<TabItem value="win" label="Powershell">
```powershell
$Env:AZURE_CLIENT_ID = "<Directory (tenant) ID for configured app>"
$Env:AZURE_TENANT_ID = "<Application (client) ID for configured app>"
$Env:AZURE_CLIENT_SECRET = "<Client secret value>"
```
</TabItem>
<TabItem value="unix" label="Linux/macOS">
```bash
export AZURE_TENANT_ID=<Directory (tenant) ID for configured app>
export AZURE_CLIENT_ID=<Application (client) ID for configured app>
export AZURE_CLIENT_SECRET=<Client secret value>
```
</TabItem>
<TabItem value="docker" label="Docker">
```bash
export AZURE_TENANT_ID=<Directory (tenant) ID for configured app>
export AZURE_CLIENT_ID=<Application (client) ID for configured app>
export AZURE_CLIENT_SECRET=<Client secret value>
```
</TabItem>
</Tabs>
## Repository creation
To create a secure backup location for Corso, we will create a bucket (`corso-test` is used as an example) in AWS S3.
The following commands assume that all configuration values from the previous step, `AWS_ACCESS_KEY_ID`, and
`AWS_SECRET_ACCESS_KEY` are available to the Corso binary or container.
<Tabs groupId="os">
<TabItem value="win" label="Powershell">
```powershell
# Create the AWS S3 Bucket
aws s3api create-bucket --bucket corso-test
```
</TabItem>
<TabItem value="unix" label="Linux/macOS">
```bash
# Create the AWS S3 Bucket
aws s3api create-bucket --bucket corso-test
```
</TabItem>
<TabItem value="docker" label="Docker">
```bash
# Create the AWS S3 Bucket
aws s3api create-bucket --bucket corso-test
```
</TabItem>
</Tabs>
Next, let's initialize the Corso repository using an encryption passphrase.
<Tabs groupId="os">
<TabItem value="win" label="Powershell">
```powershell
# Initialize the Corso Repository
$Env:CORSO_PASSPHRASE = "CHANGE-ME-THIS-IS-INSECURE"
.\corso.exe repo init s3 --bucket corso-test
```
</TabItem>
<TabItem value="unix" label="Linux/macOS">
```bash
# Initialize the Corso Repository
export CORSO_PASSPHRASE="CHANGE-ME-THIS-IS-INSECURE"
corso repo init s3 --bucket corso-test
```
</TabItem>
<TabItem value="docker" label="Docker">
```bash
# Initialize the Corso Repository
export CORSO_PASSPHRASE="CHANGE-ME-THIS-IS-INSECURE"
docker run --env-file ~/.corso/corso.env \
--volume $HOME/.corso:/app/corso corso/corso:latest \
repo init s3 --bucket corso-test
```
</TabItem>
</Tabs>
## Your first backup ## Your first backup

View File

@ -11,7 +11,7 @@ Two things are needed to run Corso:
* Environment variables containing configuration information * Environment variables containing configuration information
* A directory for Corso to store its configuration file * A directory for Corso to store its configuration file
## Environment Variables ## Environment variables
Three distinct pieces of configuration are required by Corso: Three distinct pieces of configuration are required by Corso:
@ -32,7 +32,12 @@ alternate ways to pass AWS credentials.
<Tabs groupId="os"> <Tabs groupId="os">
<TabItem value="win" label="Powershell"> <TabItem value="win" label="Powershell">
Ensure that all of the above environment variables are available in your Powershell environment. Ensure that all of the above environment variables are defined in your Powershell environment.
</TabItem>
<TabItem value="unix" label="Linux/macOS">
Ensure that all of the above environment variables are defined in your shell environment.
</TabItem> </TabItem>
<TabItem value="docker" label="Docker"> <TabItem value="docker" label="Docker">
@ -43,7 +48,7 @@ To create the environment variables file, you can run the following command:
```bash ```bash
# Create an environment variables file # Create an environment variables file
cat <<EOF ~/.corso/corso.env cat <<EOF > ~/.corso/corso.env
CORSO_PASSPHRASE CORSO_PASSPHRASE
AZURE_TENANT_ID AZURE_TENANT_ID
AZURE_CLIENT_ID AZURE_CLIENT_ID
@ -62,7 +67,13 @@ To create the environment variables file, you can run the following command:
<Tabs groupId="os"> <Tabs groupId="os">
<TabItem value="win" label="Powershell"> <TabItem value="win" label="Powershell">
By default, Corso store its configuration file (`.corso.toml`) in the directory where the binary is executed. By default, Corso stores its configuration file (`.corso.toml`) in the root of the home directory.
The location of the configuration file can be specified using the `--config-file` option.
</TabItem>
<TabItem value="unix" label="Linux/macOS">
By default, Corso store its configuration file (`.corso.toml`) in the root of the home directory.
The location of the configuration file can be specified using the `--config-file` option. The location of the configuration file can be specified using the `--config-file` option.
</TabItem> </TabItem>

View File

@ -4,6 +4,9 @@ description: "Connect to a Microsft 365 tenant"
# Microsoft 365 access # Microsoft 365 access
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
To perform backup and restore operations, Corso requires access to your [M365 tenant](concepts#m365-concepts) To perform backup and restore operations, Corso requires access to your [M365 tenant](concepts#m365-concepts)
through an [Azure AD application](concepts#m365-concepts) with appropriate permissions. through an [Azure AD application](concepts#m365-concepts) with appropriate permissions.
@ -59,10 +62,32 @@ as environment variables.
To extract the tenant and client ID, select Overview from the app management panel and export the corresponding To extract the tenant and client ID, select Overview from the app management panel and export the corresponding
environment variables. environment variables.
```bash <Tabs groupId="os">
export AZURE_TENANT_ID=<Directory (tenent) ID for configured app> <TabItem value="win" label="Powershell">
export AZURE_CLIENT_ID=<Application (client) ID for configured app>
``` ```powershell
$Env:AZURE_CLIENT_ID = "<Directory (tenant) ID for configured app>"
$Env:AZURE_TENANT_ID = "<Application (client) ID for configured app>"
```
</TabItem>
<TabItem value="unix" label="Linux/macOS">
```bash
export AZURE_TENANT_ID=<Directory (tenant) ID for configured app>
export AZURE_CLIENT_ID=<Application (client) ID for configured app>
```
</TabItem>
<TabItem value="docker" label="Docker">
```bash
export AZURE_TENANT_ID=<Directory (tenant) ID for configured app>
export AZURE_CLIENT_ID=<Application (client) ID for configured app>
```
</TabItem>
</Tabs>
<img src="/img/m365app_ids.png" className="guideImages"/> <img src="/img/m365app_ids.png" className="guideImages"/>
@ -74,8 +99,28 @@ management panel.
Click **New Client Secret** and follow the instructions to create a secret. After creating the secret, copy the secret Click **New Client Secret** and follow the instructions to create a secret. After creating the secret, copy the secret
value right away because it won't be available later and export it as an environment variable. value right away because it won't be available later and export it as an environment variable.
```bash <Tabs groupId="os">
export AZURE_CLIENT_SECRET=<client secret value> <TabItem value="win" label="Powershell">
```
```powershell
$Env:AZURE_CLIENT_SECRET = "<Client secret value>"
```
</TabItem>
<TabItem value="unix" label="Linux/macOS">
```bash
export AZURE_CLIENT_SECRET=<Client secret value>
```
</TabItem>
<TabItem value="docker" label="Docker">
```bash
export AZURE_CLIENT_SECRET=<Client secret value>
```
</TabItem>
</Tabs>
<img src="/img/m365app_secret.png" className="guideImages"/> <img src="/img/m365app_secret.png" className="guideImages"/>