Skip to content

Commit 5b708fc

Browse files
authored
Remove useExistingResources parameter and add CLI deployment commands (#17)
- Remove useExistingResources parameter from azurefireflydeploy.json - Remove useExistingResources parameter from azurefireflydeploy-managementgroups.json - Remove all conditions that depended on useExistingResources - Add Azure CLI deployment commands to README for both subscription and management group deployments - Add parameter reference table to README - Remove offboarding template references from README * **What kind of change does this PR introduce?** - [ ] Bug fix - [ ] Feature - [ ] Code maintenance - [ ] Performance enhancement * **Description of the changes included in this PR (In case of a bug fix, please highlight the expected behaviour vs the observed one)** * **Does this PR introduce a breaking change?** * **Please declare that your PR fulfills these requirements:** - [ ] Unit tests covering my changes are included - [ ] I successfully ran my code on my local setup - [ ] This branch has been successfully deployed in a development environment - [ ] This branch has been successfully deployed to staging environment - [ ] All required environment variables have been updated via ArgoCD - [ ] My code follows the project's style guidelines and has been linted - [ ] Documentation have been added / updated (please add a link)
1 parent 6e1061a commit 5b708fc

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,31 @@ Firefly is a comprehensive cloud asset management platform that helps organizati
154154

155155
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgofireflyio%2Farm-firefly-azure-onboarding%2Frefs%2Fheads%2Fmain%2Fazurefireflydeploy-managementgroups.json/createUIDefinitionUri/https%3A%2F%2Fraw.githubusercontent.com%2Fgofireflyio%2Farm-firefly-azure-onboarding%2Frefs%2Fheads%2Fmain%2FCreateUIDefinition-managementgroups.json)
156156

157-
⚠️ **Offboarding Template**: Completely removes all Azure resources created by Firefly onboarding.
157+
### **Offboarding (Azure CLI)**
158+
159+
To remove Firefly resources from your Azure subscription, run these commands:
160+
161+
```
162+
# 1. List Firefly diagnostic settings
163+
az monitor diagnostic-settings subscription list --query "[?contains(name, 'firefly')]"
164+
165+
# 2. Delete diagnostic settings (replace <name> with actual name from step 1)
166+
az monitor diagnostic-settings subscription delete --name "<name>" --yes
167+
168+
# 3. List Firefly resource groups
169+
az group list --query "[?contains(name, 'firefly')].{Name:name, Location:location}" -o table
170+
171+
# 4. Delete Firefly resource group (this deletes all resources inside)
172+
az group delete --name "firefly-monitoring-<subscription-id>" --yes
173+
174+
# 5. List Firefly custom role definitions
175+
az role definition list --custom-role-only --query "[?contains(roleName, 'Firefly')].{Name:roleName}" -o table
176+
177+
# 6. Delete Firefly custom role definition (replace <role-name> with actual name)
178+
az role definition delete --name "<role-name>"
179+
```
180+
181+
> **Note:** Remember to also remove the integration from the Firefly dashboard.
158182
159183
## 📝 Step-by-Step Deployment Guide
160184

@@ -455,10 +479,8 @@ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.
455479
### **Template Components**
456480
- 📋 [azurefireflydeploy.json](azurefireflydeploy.json) - Main onboarding template
457481
- 📋 [azurefireflydeploy-managementgroups.json](azurefireflydeploy-managementgroups.json) - Management group deployment
458-
- 🗑️ [azurefirelfyoffboard.json](azurefirelfyoffboard.json) - Offboarding template
459482
- 🎨 [CreateUIDefinition.json](CreateUIDefinition.json) - UI for single/multi-subscription onboarding
460483
- 🎨 [CreateUIDefinition-managementgroups.json](CreateUIDefinition-managementgroups.json) - UI for management group deployment
461-
- 🎨 [CreateUIDefinition-offboard.json](CreateUIDefinition-offboard.json) - UI for offboarding
462484

463485
## 📄 License
464486

azurefireflydeploy-managementgroups.json

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@
9292
"metadata": {
9393
"description": "Just a Guid to append to deployment script name"
9494
}
95-
},
96-
"useExistingResources": {
97-
"type": "bool",
98-
"defaultValue": false,
99-
"metadata": {
100-
"description": "When true, skips creation of storage account, event grid, roles, and diagnostic settings (assumes they already exist)"
101-
}
10295
}
10396
},
10497
"variables": {
@@ -137,7 +130,7 @@
137130
}
138131
},
139132
{
140-
"condition": "[not(parameters('useExistingResources'))]",
133+
141134
"type": "Microsoft.Authorization/roleAssignments",
142135
"apiVersion": "2020-10-01-preview",
143136
"name": "[guid(parameters('managementGroupId'), 'firefly reader mg', parameters('servicePrincipalObjectId'), parameters('newguid'))]",
@@ -149,7 +142,7 @@
149142
}
150143
},
151144
{
152-
"condition": "[not(parameters('useExistingResources'))]",
145+
153146
"type": "Microsoft.Authorization/roleAssignments",
154147
"apiVersion": "2020-10-01-preview",
155148
"name": "[guid(parameters('managementGroupId'), 'firefly billing reader mg', parameters('servicePrincipalObjectId'), parameters('newguid'))]",
@@ -161,7 +154,7 @@
161154
}
162155
},
163156
{
164-
"condition": "[not(parameters('useExistingResources'))]",
157+
165158
"type": "Microsoft.Authorization/roleAssignments",
166159
"apiVersion": "2020-10-01-preview",
167160
"name": "[guid(parameters('managementGroupId'), 'firefly app config reader mg', parameters('servicePrincipalObjectId'), parameters('newguid'))]",
@@ -173,7 +166,7 @@
173166
}
174167
},
175168
{
176-
"condition": "[not(parameters('useExistingResources'))]",
169+
177170
"type": "Microsoft.Authorization/roleAssignments",
178171
"apiVersion": "2020-10-01-preview",
179172
"name": "[guid(parameters('managementGroupId'), 'firefly security reader mg', parameters('servicePrincipalObjectId'), parameters('newguid'))]",
@@ -185,7 +178,7 @@
185178
}
186179
},
187180
{
188-
"condition": "[not(parameters('useExistingResources'))]",
181+
189182
"type": "Microsoft.Authorization/roleAssignments",
190183
"apiVersion": "2020-10-01-preview",
191184
"name": "[guid(parameters('managementGroupId'), 'firefly monitoring reader mg', parameters('servicePrincipalObjectId'), parameters('newguid'))]",
@@ -208,7 +201,7 @@
208201
}
209202
},
210203
{
211-
"condition": "[not(parameters('useExistingResources'))]",
204+
212205
"type": "Microsoft.Resources/deployments",
213206
"apiVersion": "2021-04-01",
214207
"name": "[concat('firefly-roles-', parameters('newguid'))]",
@@ -384,7 +377,7 @@
384377
}
385378
},
386379
{
387-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
380+
"condition": "[parameters('eventDrivenEnabled')]",
388381
"type": "Microsoft.Resources/deployments",
389382
"apiVersion": "2021-04-01",
390383
"name": "[concat('firefly-resources-', parameters('newguid'))]",
@@ -492,7 +485,7 @@
492485
}
493486
},
494487
{
495-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
488+
"condition": "[parameters('eventDrivenEnabled')]",
496489
"type": "Microsoft.Insights/diagnosticSettings",
497490
"apiVersion": "2021-05-01-preview",
498491
"name": "[concat('firefly-mg-diagnostics-', parameters('newguid'))]",
@@ -515,7 +508,7 @@
515508
}
516509
},
517510
{
518-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
511+
"condition": "[parameters('eventDrivenEnabled')]",
519512
"type": "Microsoft.Resources/deployments",
520513
"apiVersion": "2021-04-01",
521514
"name": "[concat('firefly-mg-diagnostics-', parameters('newguid'))]",

azurefireflydeploy.json

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@
9191
"metadata": {
9292
"description": "Just a Guid to append to deployment script name"
9393
}
94-
},
95-
"useExistingResources": {
96-
"type": "bool",
97-
"defaultValue": false,
98-
"metadata": {
99-
"description": "When true, skips creation of storage account and event grid topic (assumes they already exist)"
100-
}
10194
}
10295
},
10396
"variables": {
@@ -159,8 +152,7 @@
159152
"isProd": { "value": "[parameters('isProd')]" },
160153
"newguid": { "value": "[parameters('newguid')]" },
161154
"directoryDomain": { "value": "[parameters('directoryDomain')]" },
162-
"location": { "value": "[parameters('location')]" },
163-
"useExistingResources": { "value": "[parameters('useExistingResources')]" }
155+
"location": { "value": "[parameters('location')]" }
164156
},
165157
"template": {
166158
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
@@ -183,8 +175,7 @@
183175
"isProd": { "type": "bool" },
184176
"newguid": { "type": "string" },
185177
"directoryDomain": { "type": "string" },
186-
"location": { "type": "string" },
187-
"useExistingResources": { "type": "bool" }
178+
"location": { "type": "string" }
188179
},
189180
"variables": {
190181
"resourceGroupName": "[concat('firefly-monitoring-', parameters('targetSubscriptionId'))]"
@@ -199,7 +190,6 @@
199190
"properties": {}
200191
},
201192
{
202-
"condition": "[not(parameters('useExistingResources'))]",
203193
"type": "Microsoft.Resources/deployments",
204194
"apiVersion": "2021-04-01",
205195
"name": "[concat('firefly-roles-', parameters('newguid'))]",
@@ -422,7 +412,7 @@
422412
}
423413
},
424414
{
425-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
415+
"condition": "[parameters('eventDrivenEnabled')]",
426416
"type": "Microsoft.Resources/deployments",
427417
"apiVersion": "2021-04-01",
428418
"name": "[concat('firefly-resources-', parameters('newguid'))]",
@@ -449,8 +439,7 @@
449439
"uniqueEventGridTopicName": { "value": "[parameters('uniqueEventGridTopicName')]" },
450440
"fireflyWebhookUrl": { "value": "[parameters('fireflyWebhookUrl')]" },
451441
"eventDrivenEnabled": { "value": "[parameters('eventDrivenEnabled')]" },
452-
"resourceGroupName": { "value": "[variables('resourceGroupName')]" },
453-
"useExistingResources": { "value": "[parameters('useExistingResources')]" }
442+
"resourceGroupName": { "value": "[variables('resourceGroupName')]" }
454443
},
455444
"template": {
456445
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
@@ -467,13 +456,11 @@
467456
"uniqueEventGridTopicName": { "type": "string" },
468457
"fireflyWebhookUrl": { "type": "string" },
469458
"eventDrivenEnabled": { "type": "bool" },
470-
"resourceGroupName": { "type": "string" },
471-
"useExistingResources": { "type": "bool" }
459+
"resourceGroupName": { "type": "string" }
472460
},
473461
"variables": {},
474462
"resources": [
475463
{
476-
"condition": "[not(parameters('useExistingResources'))]",
477464
"type": "Microsoft.Storage/storageAccounts",
478465
"apiVersion": "2021-09-01",
479466
"name": "[parameters('uniqueStorageAccountName')]",
@@ -492,7 +479,6 @@
492479
}
493480
},
494481
{
495-
"condition": "[not(parameters('useExistingResources'))]",
496482
"type": "Microsoft.EventGrid/systemTopics",
497483
"apiVersion": "2021-12-01",
498484
"name": "[parameters('uniqueEventGridTopicName')]",
@@ -507,7 +493,6 @@
507493
]
508494
},
509495
{
510-
"condition": "[not(parameters('useExistingResources'))]",
511496
"type": "Microsoft.EventGrid/systemTopics/eventSubscriptions",
512497
"apiVersion": "2021-12-01",
513498
"name": "[concat(parameters('uniqueEventGridTopicName'), '/firefly-webhook')]",
@@ -540,7 +525,7 @@
540525
}
541526
},
542527
{
543-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
528+
"condition": "[parameters('eventDrivenEnabled')]",
544529
"type": "Microsoft.Resources/deployments",
545530
"apiVersion": "2021-04-01",
546531
"name": "[concat('firefly-storage-roles-', parameters('newguid'))]",
@@ -666,7 +651,7 @@
666651
}
667652
},
668653
{
669-
"condition": "[and(parameters('eventDrivenEnabled'), not(parameters('useExistingResources')))]",
654+
"condition": "[parameters('eventDrivenEnabled')]",
670655
"type": "Microsoft.Resources/deployments",
671656
"apiVersion": "2021-04-01",
672657
"name": "[concat('firefly-diag-settings-', parameters('newguid'))]",

0 commit comments

Comments
 (0)