Skip to content

Commit 54da26a

Browse files
authored
Merge pull request #97052 from docohe/follower-update
Update ADX follower documentation
2 parents ded5e0d + 86001dd commit 54da26a

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

articles/data-explorer/follower.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,26 @@ There are various methods you can use to attach a database. In this article, we
4343
var tenantId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Directory (tenant) ID
4444
var clientId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Application ID
4545
var clientSecret = "xxxxxxxxxxxxxx";//Client secret
46-
var subscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
46+
var leaderSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
47+
var followerSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
4748

4849
var serviceCreds = await ApplicationTokenProvider.LoginSilentAsync(tenantId, clientId, clientSecret);
49-
var resourceManagementClient = new ResourceManagementClient(serviceCreds);
50+
var resourceManagementClient = new KustoManagementClient(serviceCreds){
51+
SubscriptionId = followerSubscriptionId
52+
};
5053

51-
var leaderResourceGroupName = "testrg";
5254
var followerResourceGroupName = "followerResouceGroup";
55+
var leaderResourceGroup = "leaderResouceGroup";
5356
var leaderClusterName = "leader";
5457
var followerClusterName = "follower";
5558
var attachedDatabaseConfigurationName = "adc";
56-
var databaseName = "db" // Can be specific database name or * for all databases
59+
var databaseName = "db"; // Can be specific database name or * for all databases
5760
var defaultPrincipalsModificationKind = "Union";
5861
var location = "North Central US";
5962

6063
AttachedDatabaseConfiguration attachedDatabaseConfigurationProperties = new AttachedDatabaseConfiguration()
6164
{
62-
ClusterResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{followerResourceGroupName}/providers/Microsoft.Kusto/Clusters/{followerClusterName}",
65+
ClusterResourceId = $"/subscriptions/{leaderSubscriptionId}/resourceGroups/{leaderResourceGroup}/providers/Microsoft.Kusto/Clusters/{leaderClusterName}",
6366
DatabaseName = databaseName,
6467
DefaultPrincipalsModificationKind = defaultPrincipalsModificationKind,
6568
Location = location
@@ -193,10 +196,13 @@ Follower cluster can detach any attached database as follows:
193196
var tenantId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Directory (tenant) ID
194197
var clientId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Application ID
195198
var clientSecret = "xxxxxxxxxxxxxx";//Client secret
196-
var subscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
199+
var leaderSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
200+
var followerSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
197201

198202
var serviceCreds = await ApplicationTokenProvider.LoginSilentAsync(tenantId, clientId, clientSecret);
199-
var resourceManagementClient = new ResourceManagementClient(serviceCreds);
203+
var resourceManagementClient = new KustoManagementClient(serviceCreds){
204+
SubscriptionId = followerSubscriptionId
205+
};
200206

201207
var followerResourceGroupName = "testrg";
202208
//The cluster and database that are created as part of the prerequisites
@@ -214,10 +220,13 @@ The leader cluster can detach any attached database as follows:
214220
var tenantId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Directory (tenant) ID
215221
var clientId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";//Application ID
216222
var clientSecret = "xxxxxxxxxxxxxx";//Client secret
217-
var subscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
223+
var leaderSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
224+
var followerSubscriptionId = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx";
218225

219226
var serviceCreds = await ApplicationTokenProvider.LoginSilentAsync(tenantId, clientId, clientSecret);
220-
var resourceManagementClient = new ResourceManagementClient(serviceCreds);
227+
var resourceManagementClient = new KustoManagementClient(serviceCreds){
228+
SubscriptionId = leaderSubscriptionId
229+
};
221230

222231
var leaderResourceGroupName = "testrg";
223232
var followerResourceGroupName = "followerResouceGroup";
@@ -227,7 +236,7 @@ var followerClusterName = "follower";
227236
var followerDatabaseDefinition = new FollowerDatabaseDefinition()
228237
{
229238
AttachedDatabaseConfigurationName = "adc",
230-
ClusterResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{followerResourceGroupName}/providers/Microsoft.Kusto/Clusters/{followerClusterName}"
239+
ClusterResourceId = $"/subscriptions/{followerSubscriptionId}/resourceGroups/{followerResourceGroupName}/providers/Microsoft.Kusto/Clusters/{followerClusterName}"
231240
};
232241

233242
resourceManagementClient.Clusters.DetachFollowerDatabases(leaderResourceGroupName, leaderClusterName, followerDatabaseDefinition);
@@ -237,12 +246,12 @@ resourceManagementClient.Clusters.DetachFollowerDatabases(leaderResourceGroupNam
237246

238247
### Manage principals
239248

240-
When attaching a database, specify the **default principals modification kind"**. The default is keeping the leader database collection of [authorized principals](/azure/kusto/management/access-control/index#authorization)
249+
When attaching a database, specify the **"default principals modification kind"**. The default is keeping the leader database collection of [authorized principals](/azure/kusto/management/access-control/index#authorization)
241250

242251
|**Kind** |**Description** |
243252
|---------|---------|
244253
|**Union** | The attached database principals will always include the original database principals plus additional new principals added to the follower database. |
245-
|**Replace** | No inheritance of principals from the original database. New principals must be created for the attached database. At least one principal needs to be added to block principal inheritance. |
254+
|**Replace** | No inheritance of principals from the original database. New principals must be created for the attached database. |
246255
|**None** | The attached database principals include only the principals of the original database with no additional principals. |
247256

248257
For more information about using control commands to configure the authorized principals, see [Control commands for managing a follower cluster](/azure/kusto/management/cluster-follower).

0 commit comments

Comments
 (0)