You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: improve Azure SQL Managed Identity authentication documentation
- Renamed section from "Entra Managed Identity" to "Azure SQL with Managed Identity Authentication" for clarity
- Restructured content to follow the same secure pattern as AWS and GCP sections
- Emphasized VM-attached managed identity approach as the most secure method
- Added comprehensive Azure documentation references throughout
- Included security best practices and production recommendations
- Removed screenshots in favor of text instructions with official documentation links
- Added step-by-step configuration with proper SQL permission examples
- Clarified that no credentials (AZURE_TENANT_ID, AZURE_CLIENT_SECRET) are needed with managed identities
- Added alternative user-assigned managed identity configuration
- Improved readability with consistent formatting and structure
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update mintlify/get-started/instance.mdx
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: h3n4l <[email protected]>
Copy file name to clipboardExpand all lines: mintlify/get-started/instance.mdx
+85-21Lines changed: 85 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -448,42 +448,106 @@ Go to instance setting, specify the fully qualified name such as `projects/22871
448
448
449
449
## Azure Configuration
450
450
451
-
### Entra Managed Identity
451
+
### Azure SQL with Managed Identity Authentication
452
452
453
-
Bytebase supports connect to Azure SQL through Azure IAM by using default Azure credential and client secret credential. This section introduces how to use [system-assigned managed identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview#managed-identity-types) to connect to Azure SQL.
454
-
For more information about the credential chain in default Azure credential, please refer to [default azure credential overview](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/credential-chains#how-a-chained-credential-works).
453
+
This guide demonstrates the most secure method for connecting to Azure SQL Database and Azure SQL Managed Instance using VM-attached managed identities, eliminating the need to manage credentials or connection strings.
455
454
456
-
#### Create a VM with enabled system-assigned managed identity
455
+
For alternative authentication methods and detailed configuration options, refer to:
-[Managed identities for Azure resources](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview)
458
+
-[Configure Azure AD authentication for SQL Database](https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure)
459
+
-[Connect to Azure SQL with managed identity](https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-user-assigned-managed-identity)
457
460
458
-
1. Enable system assigned managed identity while creating a VM.
#### Step 1: Create Azure VM with System-Assigned Managed Identity
460
462
461
-
2. Deploy the Bytebase on the VM in Docker.
462
-
463
-
#### Enable Microsoft Entra Authentication in Azure SQL
464
-
465
-
1. Go to the Azure SQL panel, and set the Microsoft Entra Admin for Azure SQL managed instance, don't forget to click Save button. Once you set the Microsoft Entra Admin, the Microsoft Entra authentication is enabled. Check the [Microsoft guide](https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/configure-azure-ad-authentication-for-sql-vm?view=azuresql&tabs=azure-portal) if you use Azure SQL on VM.
463
+
1.**Create VM with Managed Identity**
464
+
- Go to [Azure Portal → Virtual Machines](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Compute%2FVirtualMachines)
465
+
- Click **Create** → **Azure virtual machine**
466
+
- Configure VM settings as needed
467
+
- Under **Management** tab:
468
+
- Enable **System assigned managed identity**: Set to **On**
469
+
- Complete VM creation
470
+
471
+
> **Security Best Practice:** System-assigned managed identities are automatically managed by Azure and tied to the VM lifecycle. This eliminates credential management and reduces security risks. Learn more: [Managed identity best practices](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations)
Deploy Bytebase on your Azure VM. The VM's managed identity is automatically available - no credential configuration needed.
468
476
469
-
#### Create a contained database user
477
+
#### Step 2: Configure Azure SQL Database
470
478
471
-
1. Connect to the Azure SQL database using the Microsoft Entra Admin account.
479
+
1.**Enable Microsoft Entra Authentication**
480
+
- Navigate to your Azure SQL Server in [Azure Portal](https://portal.azure.com)
481
+
- Go to **Settings** → **Microsoft Entra ID**
482
+
- Click **Set admin** and select an Entra admin account
483
+
- Click **Save** to enable Entra authentication
484
+
485
+
Reference: [Configure Entra authentication for Azure SQL](https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure)
472
486
473
-
2. For each databases desired to be managed by Bytebase, running the following SQL command inside the database to create a contained database user:
487
+
2.**Grant Database Access to Managed Identity**
488
+
- Note your VM's managed identity name (same as VM name)
489
+
- Connect to Azure SQL using the Entra admin account
490
+
- Run the following for each database:
474
491
475
492
```sql
476
-
CREATE USER [<Microsoft_Entra_principal_name>] FROM EXTERNAL PROVIDER;
477
-
ALTER ROLE db_owner ADD MEMBER [<Microsoft_Entra_principal_name>];
493
+
-- Create user for the VM's managed identity
494
+
CREATE USER [your-vm-name] FROM EXTERNAL PROVIDER;
495
+
496
+
-- Grant appropriate permissions (adjust as needed)
497
+
ALTER ROLE db_datareader ADD MEMBER [your-vm-name];
498
+
ALTER ROLE db_datawriter ADD MEMBER [your-vm-name];
499
+
ALTER ROLE db_ddladmin ADD MEMBER [your-vm-name];
500
+
501
+
-- For full database management in Bytebase:
502
+
ALTER ROLE db_owner ADD MEMBER [your-vm-name];
478
503
```
504
+
505
+
> **Production Best Practice:** Follow the principle of least privilege. Grant only the minimum permissions required for your use case. See [Azure SQL Database permissions](https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage).
506
+
507
+
#### Step 3: Connect from Bytebase
479
508
480
-
#### Connect to Azure SQL Database in Bytebase
509
+
1. Access Bytebase on your VM (typically `http://localhost:5678`)
510
+
2. Click **New Instance**
511
+
3. Configure the connection:
512
+
-**Host:** Your Azure SQL server name (e.g., `yourserver.database.windows.net`)
For troubleshooting, see [Troubleshoot managed identity authentication](https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-user-assigned-managed-identity#troubleshooting).
528
+
</Tip>
529
+
530
+
#### Alternative: User-Assigned Managed Identity
531
+
532
+
For more granular control or cross-resource scenarios:
533
+
534
+
1.**Create User-Assigned Managed Identity**
535
+
- Go to [Managed Identities](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.ManagedIdentity%2FuserAssignedIdentities)
536
+
- Create a new identity with a descriptive name
537
+
- Assign it to your VM under **Settings** → **Identity** → **User assigned**
538
+
539
+
2.**Configure Database Access**
540
+
```sql
541
+
CREATE USER [managed-identity-name] FROM EXTERNAL PROVIDER;
542
+
ALTER ROLE db_owner ADD MEMBER [managed-identity-name];
543
+
```
544
+
545
+
3.**Set Environment Variable** (if using multiple identities)
In this way, Bytebase can only connect to one specific Azure SQL database. To manage multiple Azure SQL databases in one instance inside Bytebase, considering set the VM principal as the Azure SQL Managed Instance Microsoft Entra Admin.
0 commit comments