Skip to content

Commit b78d2d6

Browse files
authored
Fixed Grafana role assignments (#21)
* changed provider registration * added missing character * removed orphaned code * added assignee type for RBAC * fixed assignee * skipping default role assignment for Grafana * disabled monitoring * removed skip-roleassignments * changed Azure login * re-enabled az login and skip-role-assignments * re-enabled workflow execution
1 parent c113e73 commit b78d2d6

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

.github/workflows/build-vm.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@ jobs:
156156
--admin-password $adminPassword \
157157
--assign-identity $identity
158158
159-
- name: Install HCI Box
160-
run: |
161-
hciRPObjectId="$(az ad sp list --display-name "Microsoft.AzureStackHCI Resource Provider" | jq -r '.[].id')"
162-
163159
- name: Install provider extensions
164160
run: |
165161
az provider register -n "Microsoft.ExtendedLocation"

scripts/configure-azmon-grafana.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fi
7171
grafana=$(az grafana list --query "[?resourceGroup=='$resourceGroup']" -o json | jq -c '.[0]')
7272
if [ -z $(az grafana list --query "[?resourceGroup=='$resourceGroup'].name" -o tsv) ]; then
7373
echo "Creating Grafana resource in azure..."
74-
grafana=$(az grafana create -n $grafanaName -g $resourceGroup | jq -c .)
74+
grafana=$(az grafana create -n $grafanaName -g $resourceGroup --skip-role-assignments | jq -c .)
7575
else
7676
grafanaName=$(echo $grafana | jq -r .name)
7777
echo "Grafana resource ($grafanaName) found. Use existing..."
@@ -80,6 +80,7 @@ fi
8080
grafanaIdentity=$(echo $grafana | jq -r '.identity.principalId')
8181
echo "Grafana identity: $grafanaIdentity"
8282
az role assignment create --assignee $grafanaIdentity --role "Monitoring Data Reader" --scope /subscriptions/$subscriptionId/resourceGroups/$resourceGroup
83+
az role assignment create --assignee $grafanaIdentity --role "Monitoring Reader" --scope /subscriptions/$subscriptionId/resourceGroups/$resourceGroup
8384

8485
if [[ -z $(az grafana data-source show -n $grafanaName --data-source "Azure Managed Prometheus-1" 2>/dev/null | jq .name) ]]; then
8586
echo "Adding prometheus data source to Grafana..."

0 commit comments

Comments
 (0)