-
Notifications
You must be signed in to change notification settings - Fork 709
br: add a new authentication method for Azure #22267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
121c5c6
0420e24
5a4874f
72693a2
31f224a
1f58232
59b047b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -203,6 +203,66 @@ You can configure the account used to access GCS by specifying the access key. I | |||||
| --storage "azure://external/backup-20220915?account-name=${account-name}" | ||||||
| ``` | ||||||
|
|
||||||
| - Method 4: Use Azure managed identities | ||||||
|
|
||||||
| Starting from v8.5.5 and v9.0.0, if your TiDB cluster and BR are running in an Azure Virtual Machine (VM) or Azure Kubernetes Service (AKS) environment and Azure managed identities have been assigned to the nodes, you can use Azure managed identities for authentication. | ||||||
|
|
||||||
| Before using this method, ensure that you have granted the permissions (such as `Storage Blob Data Contributor`) to the corresponding managed identity to access the target storage account in the [Azure Portal](https://azure.microsoft.com/). | ||||||
|
|
||||||
| - **System-assigned managed identity**: | ||||||
|
|
||||||
| When using a system-assigned managed identity, there is no need to configure any Azure-related environment variables. You can simply run the BR backup command. | ||||||
|
|
||||||
| ```shell | ||||||
| tiup br backup full -u "${PD_IP}:2379" \ | ||||||
| --storage "azure://external/backup-20220915?account-name=${account-name}" | ||||||
| ``` | ||||||
|
|
||||||
| > **Note:** | ||||||
| > | ||||||
| > Ensure that the `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, or `AZURE_CLIENT_SECRET` environment variables do **not** exist in the running environment. Otherwise, the Azure SDK might prioritize other authentication methods, preventing the managed identity from taking effect. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| - **User-assigned managed identity**: | ||||||
|
|
||||||
| When using a user-assigned managed identity, you need to configure the `AZURE_CLIENT_ID` environment variable in the running environment of TiKV and BR, set its value to the client ID of the managed identity, and then run the BR backup command. The detailed steps are as follows: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 1. Configure the client ID for TiKV when starting with TiUP: | ||||||
|
|
||||||
| The following steps use the TiKV port `24000` and the systemd service name `tikv-24000` as an example: | ||||||
|
|
||||||
| 1. Open the service configuration editor by running the following command: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```shell | ||||||
| systemctl edit tikv-24000 | ||||||
| ``` | ||||||
|
|
||||||
| 2. Configure the `AZURE_CLIENT_ID` environment variable using your client ID: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```ini | ||||||
| [Service] | ||||||
| Environment="AZURE_CLIENT_ID=<your-client-id>" | ||||||
| ``` | ||||||
|
|
||||||
| 3. Reload the systemd configuration and restart TiKV: | ||||||
|
|
||||||
| ```shell | ||||||
| systemctl daemon-reload | ||||||
| systemctl restart tikv-24000 | ||||||
| ``` | ||||||
|
|
||||||
| 2. Configure the `AZURE_CLIENT_ID` environment variable for BR: | ||||||
|
|
||||||
| ```shell | ||||||
| export AZURE_CLIENT_ID="<your-client-id>" | ||||||
| ``` | ||||||
|
|
||||||
| 3. Back up data to Azure Blob Storage using the following BR command: | ||||||
|
|
||||||
| ```shell | ||||||
| tiup br backup full -u "${PD_IP}:2379" \ | ||||||
| --storage "azure://external/backup-20220915?account-name=${account-name}" | ||||||
| ``` | ||||||
|
|
||||||
| </div> | ||||||
| </SimpleTab> | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.