Skip to content

Commit 0282984

Browse files
benbpazabbasi
andauthored
Remove owner role assignments from live test ARM templates (Azure#24141)
* Remove owner role assignment from time series insights ARM template * Remove owner role assignment from digital twins ARM template * Remove owner role assignment from iot ARM template * Remove rbac owner assignment from TSI in the bicep file Co-authored-by: Azad Abbasi <azabbasi@microsoft.com>
1 parent 57f3d50 commit 0282984

File tree

5 files changed

+3
-51
lines changed

5 files changed

+3
-51
lines changed

sdk/digitaltwins/test-resources.bicep

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,8 @@ param baseName string = resourceGroup().name
99
@description('The location of the resource. By default, this is the same as the resource group.')
1010
param location string = resourceGroup().location
1111

12-
var rbacOwnerRoleDefinitionId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
1312
var adtOwnerRoleDefinitionId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/bcd981a7-7f74-457b-83e1-cceb9e632ffe'
1413

15-
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2018-09-01-preview' = {
16-
name: guid(resourceGroup().id)
17-
properties: {
18-
roleDefinitionId: rbacOwnerRoleDefinitionId
19-
principalId: testApplicationOid
20-
}
21-
}
22-
2314
resource digitaltwin 'Microsoft.DigitalTwins/digitalTwinsInstances@2020-03-01-preview' = {
2415
name: baseName
2516
location: location

sdk/digitaltwins/test-resources.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.4.63.48766",
8-
"templateHash": "14469093771711807520"
8+
"templateHash": "7080001263714194046"
99
}
1010
},
1111
"parameters": {
@@ -34,19 +34,9 @@
3434
},
3535
"functions": [],
3636
"variables": {
37-
"rbacOwnerRoleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635', subscription().subscriptionId)]",
3837
"adtOwnerRoleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/bcd981a7-7f74-457b-83e1-cceb9e632ffe', subscription().subscriptionId)]"
3938
},
4039
"resources": [
41-
{
42-
"type": "Microsoft.Authorization/roleAssignments",
43-
"apiVersion": "2018-09-01-preview",
44-
"name": "[guid(resourceGroup().id)]",
45-
"properties": {
46-
"roleDefinitionId": "[variables('rbacOwnerRoleDefinitionId')]",
47-
"principalId": "[parameters('testApplicationOid')]"
48-
}
49-
},
5040
{
5141
"type": "Microsoft.DigitalTwins/digitalTwinsInstances",
5242
"apiVersion": "2020-03-01-preview",

sdk/iot/test-resources.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
},
4747
"variables": {
4848
"iotHubResourceId": "[resourceId('Microsoft.Devices/IotHubs', parameters('baseName'))]",
49-
"rbacOwnerRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]",
5049
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
5150
"serviceSasProperties": {
5251
"canonicalizedResource": "[concat('/blob/', parameters('storageAccountName'),'/',parameters('blobContainerName'))]",
@@ -58,15 +57,6 @@
5857
}
5958
},
6059
"resources": [
61-
{
62-
"type": "Microsoft.Authorization/roleAssignments",
63-
"apiVersion": "2018-09-01-preview",
64-
"name": "[guid(resourceGroup().id)]",
65-
"properties": {
66-
"roleDefinitionId": "[variables('rbacOwnerRoleDefinitionId')]",
67-
"principalId": "[parameters('testApplicationOid')]"
68-
}
69-
},
7060
{
7161
"type": "Microsoft.Devices/IotHubs",
7262
"apiVersion": "2020-03-01",
@@ -138,4 +128,4 @@
138128
"value": "[concat('https://',parameters('storageAccountName'),'.blob.core.windows.net/',parameters('blobContainerName'),'?',listServiceSas(variables('storageAccountId'), '2018-07-01', variables('serviceSasProperties')).serviceSasToken)]"
139129
}
140130
}
141-
}
131+
}

sdk/timeseriesinsights/test-resources.bicep

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,9 @@ param eventSourceTimestampPropertyName string = '${eventSourceName}TimestampProp
4545
@description('The name of the shared access key that the Time Series Insights service will use to connect to the event hub.')
4646
param eventSourceKeyName string = 'service'
4747

48-
var rbacOwnerRoleDefinitionId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
4948
var storageAccountName = 'tsi${uniqueString(az.resourceGroup().id)}'
5049
var eventSourceResourceId = resourceId(resourceGroup, 'Microsoft.Devices/IotHubs', iotHubName)
5150

52-
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2018-09-01-preview' = {
53-
name: guid(az.resourceGroup().id)
54-
properties: {
55-
roleDefinitionId: rbacOwnerRoleDefinitionId
56-
principalId: testApplicationOid
57-
}
58-
}
59-
6051
resource iotHub 'Microsoft.Devices/IotHubs@2020-03-01' = {
6152
name: iotHubName
6253
location: region

sdk/timeseriesinsights/test-resources.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.4.63.48766",
8-
"templateHash": "7074975851172708714"
8+
"templateHash": "3831110767816828197"
99
}
1010
},
1111
"parameters": {
@@ -98,21 +98,11 @@
9898
},
9999
"functions": [],
100100
"variables": {
101-
"rbacOwnerRoleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635', subscription().subscriptionId)]",
102101
"storageAccountName": "[format('tsi{0}', uniqueString(resourceGroup().id))]",
103102
"eventSourceResourceId": "[resourceId(parameters('resourceGroup'), 'Microsoft.Devices/IotHubs', parameters('iotHubName'))]",
104103
"hubKeysId": "[resourceId('Microsoft.Devices/IotHubs/Iothubkeys', parameters('iotHubName'), 'iothubowner')]"
105104
},
106105
"resources": [
107-
{
108-
"type": "Microsoft.Authorization/roleAssignments",
109-
"apiVersion": "2018-09-01-preview",
110-
"name": "[guid(resourceGroup().id)]",
111-
"properties": {
112-
"roleDefinitionId": "[variables('rbacOwnerRoleDefinitionId')]",
113-
"principalId": "[parameters('testApplicationOid')]"
114-
}
115-
},
116106
{
117107
"type": "Microsoft.Devices/IotHubs",
118108
"apiVersion": "2020-03-01",

0 commit comments

Comments
 (0)