Skip to content

Commit c5a7e38

Browse files
authored
Updated steps to include MacOS and Linux support
Added MacOS and Linux steps for "Retrieve managed identity of the Arc Data Controller Extension" and "Assign role to the managed identity"
1 parent 5477917 commit c5a7e38

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

articles/azure-arc/data/upload-metrics.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,35 @@ The Arc data services extension managed identity is used for uploading metrics.
3333

3434
### (1) Retrieve managed identity of the Arc data controller extension
3535

36+
# [PowerShell](#tab/powershell)
3637
```powershell
3738
$Env:MSI_OBJECT_ID = (az k8s-extension show --resource-group <resource group> --cluster-name <connectedclustername> --cluster-type connectedClusters --name <name of extension> | convertFrom-json).identity.principalId
3839
#Example
3940
$Env:MSI_OBJECT_ID = (az k8s-extension show --resource-group myresourcegroup --cluster-name myconnectedcluster --cluster-type connectedClusters --name ads-extension | convertFrom-json).identity.principalId
4041
```
4142

43+
# [macOS & Linux](#tab/linux)
44+
```console
45+
export MSI_OBJECT_ID=`az k8s-extension show --resource-group <resource group> --cluster-name <connectedclustername> --cluster-type connectedClusters --name <name of extension> | jq '.identity.principalId' | tr -d \"`
46+
#Example
47+
export MSI_OBJECT_ID=`az k8s-extension show --resource-group myresourcegroup --cluster-name myconnectedcluster --cluster-type connectedClusters --name ads-extension | jq '.identity.principalId' | tr -d \"`
48+
```
49+
50+
---
51+
4252
### (2) Assign role to the managed identity
4353

4454
Run the below command to assign the **Monitoring Metrics Publisher** role:
55+
# [PowerShell](#tab/powershell)
4556
```powershell
4657
az role assignment create --assignee $Env:MSI_OBJECT_ID --role 'Monitoring Metrics Publisher' --scope "/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME"
58+
```
4759

60+
# [macOS & Linux](#tab/linux)
61+
```console
62+
az role assignment create --assignee ${MSI_OBJECT_ID} --role 'Monitoring Metrics Publisher' --scope "/subscriptions/${subscription}/resourceGroups/${resourceGroup}"
4863
```
64+
---
4965

5066
### Automatic upload of metrics can be enabled as follows:
5167
```

0 commit comments

Comments
 (0)