Skip to content

Commit 180f260

Browse files
Merge pull request #272246 from MikeRayMSFT/240321-arc-cli-ver
Update examples
2 parents 3936f22 + 3512b6f commit 180f260

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

articles/azure-arc/data/update-service-principal-credentials.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ ms.subservice: azure-arc-data
77
author: AbdullahMSFT
88
ms.author: amamun
99
ms.reviewer: mikeray
10-
ms.date: 07/30/2021
10+
ms.date: 04/16/2024
1111
ms.topic: how-to
1212
---
1313

1414
# Update service principal credentials
1515

16-
When the service principal credentials change, you need to update the secrets in the data controller.
16+
This article explains how to update the secrets in the data controller.
1717

18-
For example, if you deployed the data controller using a specific set of values for service principal tenant ID, client ID, and client secret, and then change one or more of these values, you need to update the secrets in the data controller. Following are the instructions to update Tenant ID, Client ID or the Client secret.
18+
For example, if you:
1919

20+
- Deployed the data controller using a specific set of values for service principal tenant ID, client ID, and client secret
21+
- Change one or more of these values
22+
23+
You need to update the secrets in the data controller.
2024

2125
## Background
2226

@@ -36,7 +40,7 @@ The service principal was created at [Create service principal](upload-metrics-a
3640
kubectl edit secret/upload-service-principal-secret -n arc
3741
```
3842

39-
The `kubecl edit` command opens the credentials .yml file in the default editor.
43+
The `kubectl edit` command opens the credentials .yml file in the default editor.
4044

4145

4246
1. Edit the service principal secret.
@@ -52,18 +56,18 @@ The service principal was created at [Create service principal](upload-metrics-a
5256
#
5357
apiVersion: v1
5458
data:
55-
authority: aHR0cHM6Ly9sb2dpbi5taWNyb3NvZnRvbmxpbmUuY29t
56-
clientId: NDNiNDcwYrFTGWYzOC00ODhkLTk0ZDYtNTc0MTdkN2YxM2Uw
57-
clientSecret: VFA2RH125XU2MF9+VVhXenZTZVdLdECXFlNKZi00Lm9NSw==
58-
tenantId: NzJmOTg4YmYtODZmMRFVBGTJLSATkxYWItMmQ3Y2QwMTFkYjQ3
59+
authority: <authority id>
60+
clientId: <client id>
61+
clientSecret: <client secret>==
62+
tenantId: <tenant id>
5963
kind: Secret
6064
metadata:
6165
creationTimestamp: "2020-12-02T05:02:04Z"
6266
name: upload-service-principal-secret
6367
namespace: arc
6468
resourceVersion: "7235659"
6569
selfLink: /api/v1/namespaces/arc/secrets/upload-service-principal-secret
66-
uid: 7fb693ff-6caa-4a31-b83e-9bf22be4c112
70+
uid: <globally unique identifier>
6771
type: Opaque
6872
```
6973

@@ -73,14 +77,12 @@ The service principal was created at [Create service principal](upload-metrics-a
7377
>The values need to be base64 encoded.
7478
Do not edit any other properties.
7579

76-
If an incorrect value is provided for `clientId`, `clientSecret` or `tenantID` then you will see an error message as follows in the `control-xxxx` pod/controller container logs:
80+
If an incorrect value is provided for `clientId`, `clientSecret`, or `tenantID` the command returns an error message as follows in the `control-xxxx` pod/controller container logs:
7781

7882
```output
79-
YYYY-MM-DD HH:MM:SS.mmmm | ERROR | [AzureUpload] Upload task exception: A configuration issue is preventing authentication - check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.
83+
YYYY-MM-DD HH:MM:SS.mmmm | ERROR | [AzureUpload] Upload task exception: A configuration issue is preventing authentication - check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.
8084
```
8185

82-
83-
8486
## Related content
8587

86-
[Create service principal](upload-metrics-and-logs-to-azure-monitor.md#create-service-principal)
88+
- [Create service principal](upload-metrics-and-logs-to-azure-monitor.md#create-service-principal)

articles/azure-arc/data/upload-metrics-and-logs-to-azure-monitor.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.custom: devx-track-azurecli
88
author: twright-msft
99
ms.author: twright
1010
ms.reviewer: mikeray
11-
ms.date: 11/03/2021
11+
ms.date: 04/16/2024
1212
ms.topic: how-to
1313
---
1414

@@ -72,20 +72,20 @@ az ad sp credential reset --name <ServicePrincipalName>
7272
For example, to create a service principal named `azure-arc-metrics`, run the following command
7373

7474
```azurecli
75-
az ad sp create-for-rbac --name azure-arc-metrics --role Contributor --scopes /subscriptions/a345c178a-845a-6a5g-56a9-ff1b456123z2/resourceGroups/myresourcegroup
75+
az ad sp create-for-rbac --name azure-arc-metrics --role Contributor --scopes /subscriptions/<SubscriptionId>/resourceGroups/myresourcegroup
7676
```
7777

7878
Example output:
7979

8080
```output
81-
"appId": "2e72adbf-de57-4c25-b90d-2f73f126e123",
81+
"appId": "<appId>",
8282
"displayName": "azure-arc-metrics",
8383
"name": "http://azure-arc-metrics",
84-
"password": "5039d676-23f9-416c-9534-3bd6afc78123",
85-
"tenant": "72f988bf-85f1-41af-91ab-2d7cd01ad1234"
84+
"password": "<password>",
85+
"tenant": "<tenant>"
8686
```
8787

88-
Save the `appId`, `password`, and `tenant` values in an environment variable for use later.
88+
Save the `appId`, `password`, and `tenant` values in an environment variable for use later. These values are in the form of globally unique identifier (GUID).
8989

9090
# [Windows](#tab/windows)
9191

@@ -148,11 +148,11 @@ Example output:
148148
```output
149149
{
150150
"canDelegate": null,
151-
"id": "/subscriptions/<Subscription ID>/providers/Microsoft.Authorization/roleAssignments/f82b7dc6-17bd-4e78-93a1-3fb733b912d",
152-
"name": "f82b7dc6-17bd-4e78-93a1-3fb733b9d123",
153-
"principalId": "5901025f-0353-4e33-aeb1-d814dbc5d123",
151+
"id": "/subscriptions/<Subscription ID>/providers/Microsoft.Authorization/roleAssignments/<globally unique identifier>",
152+
"name": "<globally unique identifier>",
153+
"principalId": "<principal id>",
154154
"principalType": "ServicePrincipal",
155-
"roleDefinitionId": "/subscriptions/<Subscription ID>/providers/Microsoft.Authorization/roleDefinitions/3913510d-42f4-4e42-8a64-420c39005123",
155+
"roleDefinitionId": "/subscriptions/<Subscription ID>/providers/Microsoft.Authorization/roleDefinitions/<globally unique identifier>",
156156
"scope": "/subscriptions/<Subscription ID>",
157157
"type": "Microsoft.Authorization/roleAssignments"
158158
}

0 commit comments

Comments
 (0)