Skip to content

Commit 234412b

Browse files
feature/DEV-76707: Adding develop branch support
1 parent 4cbacb8 commit 234412b

File tree

3 files changed

+19
-38
lines changed

3 files changed

+19
-38
lines changed

arm-template-deployment/deployRGParent.json

+10-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
33
"contentVersion": "1.0.0.0",
4+
"variables": {
5+
"sourceCodeBranch" : "master", // the branch to checkout the code from ('develop' for testing purpose)
6+
"templateBaseUri": "[concat('https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/',variables('sourceCodeBranch'),'/arm-template-deployment/')]",
7+
"deploymentResourceGroupName": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''),'-group')]",
8+
"eventhubNamespace": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''))]",
9+
"eventhubLogsName": "log-hub",
10+
"subscriptionId": "[subscription().subscriptionId]",
11+
"eventHubAuthorizationRuleId": "[concat('/subscriptions/', variables('subscriptionId'), '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.EventHub/namespaces/', variables('eventhubNamespace'), '/authorizationRules/RootManageSharedAccessKey')]"
12+
},
413
"parameters": {
514
"resource_group_region": {
615
"type": "String"
@@ -30,27 +39,8 @@
3039
"description": "Enable Activity logs to be sent to the event hub that will get created in this deployment"
3140
},
3241
"defaultValue": "Yes"
33-
},
34-
"sourceCodeBranch": {
35-
"type": "String",
36-
"allowedValues": [
37-
"master",
38-
"develop"
39-
],
40-
"metadata": {
41-
"description": "Github branch from which the code is to be deployed"
42-
},
43-
"defaultValue": "master"
4442
}
4543
},
46-
"variables": {
47-
"templateBaseUri": "[concat('https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/',parameters('sourceCodeBranch'),'/arm-template-deployment/')]",
48-
"deploymentResourceGroupName": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''),'-group')]",
49-
"eventhubNamespace": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''))]",
50-
"eventhubLogsName": "log-hub",
51-
"subscriptionId": "[subscription().subscriptionId]",
52-
"eventHubAuthorizationRuleId": "[concat('/subscriptions/', variables('subscriptionId'), '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.EventHub/namespaces/', variables('eventhubNamespace'), '/authorizationRules/RootManageSharedAccessKey')]"
53-
},
5444
"resources": [
5545
{
5646
"type": "Microsoft.Resources/resourceGroups",
@@ -88,7 +78,7 @@
8878
"value": "[parameters('Azure_Client_Id')]"
8979
},
9080
"sourceCodeBranch": {
91-
"value": "[parameters('sourceCodeBranch')]"
81+
"value": "[variables('sourceCodeBranch')]"
9282
}
9383
}
9484
},

arm-template-deployment/deploymentParentScript.json

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/deploymentTemplate.json#",
33
"contentVersion": "1.0.0.0",
4+
"variables": {
5+
"sourceCodeBranch": "master", // the branch to checkout the code from ('develop' for testing purpose)
6+
"templateBaseUri": "[concat('https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/',variables('sourceCodeBranch'),'/arm-template-deployment/')]",
7+
"deploymentResourceGroupName": "[concat('lm-logs-',parameters('LM_Company_name'),'-',resourceGroup().Location,'-group')]",
8+
"managedIdentityName": "[concat('msi-', variables('deploymentResourceGroupName'), '-deploy')]",
9+
"managedIdentityId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.ManagedIdentity/userAssignedIdentities/', variables('managedIdentityName'))]"
10+
},
411
"parameters": {
512
"subscriptionId": {
613
"type": "String"
@@ -12,25 +19,8 @@
1219
"defaultValue": "[utcNow()]",
1320
"type": "String",
1421
"metadata": "Please do not edit this setting"
15-
},
16-
"sourceCodeBranch": {
17-
"type": "String",
18-
"allowedValues": [
19-
"master",
20-
"develop"
21-
],
22-
"metadata": {
23-
"description": "branch from which the code is to be deployed"
24-
},
25-
"defaultValue": "master"
2622
}
2723
},
28-
"variables": {
29-
"templateBaseUri": "[concat('https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/',parameters('sourceCodeBranch'),'/arm-template-deployment/')]",
30-
"deploymentResourceGroupName": "[concat('lm-logs-',parameters('LM_Company_name'),'-',resourceGroup().Location,'-group')]",
31-
"managedIdentityName": "[concat('msi-', variables('deploymentResourceGroupName'), '-deploy')]",
32-
"managedIdentityId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.ManagedIdentity/userAssignedIdentities/', variables('managedIdentityName'))]"
33-
},
3424
"resources": [
3525
{
3626
"type": "Microsoft.Resources/deployments",
@@ -62,7 +52,7 @@
6252
"value": "[resourceGroup().Location]"
6353
},
6454
"sourceCodeBranch": {
65-
"value": "[parameters('sourceCodeBranch')]"
55+
"value": "[variables('sourceCodeBranch')]"
6656
}
6757
}
6858
},

diagnostic-settings-scripts/policyCreationAndRemediationTemplate.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ $eventhubNameSpace = $targetResourceGroup.replace('-group','')
6060
$eventhubName = 'log-hub'
6161
$eventhubAuthorizationId = 'RootManageSharedAccessKey'
6262
$templateUri = 'https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/'+$sourceCodeBranch+'/arm-template-deployment/ARMTemplateExport.json'
63+
6364
Get-AzResourceGroup -Name $targetResourceGroup -ErrorVariable notPresent -ErrorAction SilentlyContinue
6465
if ($notPresent) {
6566
Write-Host "target resource group not present..."

0 commit comments

Comments
 (0)