Skip to content

Commit 12ce962

Browse files
authored
Merge pull request #11756 from daviditkin/bug-function-app
Function App Recompilation
2 parents 3ddb8e7 + ad6efdd commit 12ce962

File tree

10 files changed

+1578
-1561
lines changed

10 files changed

+1578
-1561
lines changed

Solutions/BloodHound Enterprise/Data Connectors/AzureFunctionBloodHoundEnterprise/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "myTimer",
55
"type": "timerTrigger",
66
"direction": "in",
7-
"schedule": "0 0 1,13 * * *"
7+
"schedule": "%Schedule%"
88
}
99
]
1010
}

Solutions/BloodHound Enterprise/Data Connectors/BloodHoundEnterprise_API_FunctionApp.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,7 @@
7979
},
8080
{
8181
"title": "",
82-
"description": "**STEP 2 - Choose ONE from the following two deployment options to deploy the connector and the associated Azure Function**\n\n>**IMPORTANT:** Before deploying the BloodHound Enterprise connector, have the Workspace Name (can be copied from the following), as well as the BloodHound Enterprise API authorization key(s) or Token, readily available.",
83-
"instructions": [
84-
{
85-
"parameters": {
86-
"fillWith": [
87-
"workspaceName"
88-
],
89-
"label": "Workspace Name"
90-
},
91-
"type": "CopyableLabel"
92-
}
93-
]
82+
"description": "**STEP 2 - Choose ONE from the following two deployment options to deploy the connector and the associated Azure Function**\n\n>**IMPORTANT:** Before deploying the BloodHound Enterprise connector, have the Log Analytics Workspace Name, as well as the BloodHound Enterprise API authorization key(s) or Token, readily available."
9483
},
9584
{
9685
"title": "",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.PHONY: build clean package
2+
3+
# Packaging variables
4+
FUNCTION_NAME := function
5+
BINARY_NAME := function
6+
ZIP_NAME := bhe-funcapp.zip
7+
8+
# Go build variables
9+
GOOS := linux
10+
GOARCH := amd64
11+
12+
# Package the function app
13+
package: build
14+
@echo "Packaging"
15+
rm -f $(ZIP_NAME)
16+
zip -r $(ZIP_NAME) AzureFunctionBloodHoundEnterprise/ AzureFunctionBloodHoundEnterprise/function.json function host.json
17+
@echo "Packaging complete"
18+
19+
# Build binary
20+
build: clean
21+
@echo "Building $(BINARY_NAME)"
22+
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(BINARY_NAME)
23+
24+
# Clean up build artifacts
25+
clean:
26+
@echo "Clean"
27+
go clean
28+
rm -f $(ZIP_NAME)
29+
30+

Solutions/BloodHound Enterprise/Data Connectors/azuredeploy_BloodHoundEnterprise_API_FunctionApp.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
"metadata": {
3535
"description": "Token Key from the BloodHound Enterprise API"
3636
}
37+
},
38+
"Schedule": {
39+
"type": "string",
40+
"defaultValue": "0 0 1,13 * * *",
41+
"metadata": {
42+
"description": "Please enter a valid Quartz cron schedule. The default runs at 1am and 1pm"
43+
}
3744
}
3845
},
3946
"variables": {
@@ -77,6 +84,9 @@
7784
"workspaceID": {
7885
"value": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('workspaceName'))]"
7986
},
87+
"Schedule": {
88+
"value": "[parameters('Schedule')]"
89+
},
8090
"BHEDomain": {
8191
"value": "[parameters('BHEDomain')]"
8292
},
504 KB
Binary file not shown.

Solutions/BloodHound Enterprise/Data Connectors/deployment/BloodHoundEnterprise_function_app.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
"metadata": {
4747
"description": " The immutable Id of the Data Collection Rule"
4848
}
49+
},
50+
"Schedule": {
51+
"type": "string",
52+
"defaultValue": "0 0 1,13 * * *",
53+
"metadata": {
54+
"description": "Please enter a valid Quartz cron schedule. The default runs at 1am and 1pm"
55+
}
4956
}
5057
},
5158
"variables": {
@@ -55,6 +62,7 @@
5562
"KeyVaultName": "[substring(variables('functionName'), 0, 22)]",
5663
"BHETokenId": "BHETokenId",
5764
"BHETokenKey": "BHETokenKey",
65+
"Schedule": "[parameters('Schedule')]",
5866
"keyVaultSecretReader": "[format('/subscriptions/){0}/providers/Microsoft.Authorization/roleDefinitions/4633458b-17de-408a-b874-0445c86b69e6', subscription().subscriptionId)]",
5967
"metricsPublisher": "[format('/subscriptions/){0}/providers/Microsoft.Authorization/roleDefinitions/3913510d-42f4-4e42-8a64-420c390055eb', subscription().subscriptionId)]",
6068
"uniqueRoleGuidMetricsPublisher": "[guid(resourceId('Microsoft.Storage/storageAccounts', variables('functionName')))]",
@@ -204,6 +212,7 @@
204212
"logAnalyticsUri": "[variables('LogAnaltyicsUri')]",
205213
"logsIngestionUrl": "[parameters('logsIngestionUrl')]",
206214
"dcrImmutableId": "[parameters('dcrImmutableId')]",
215+
"Schedule": "[variables('Schedule')]",
207216
"WEBSITE_RUN_FROM_PACKAGE": "https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/Solutions/BloodHound%20Enterprise/Data%20Connectors/bhe-funcapp.zip"
208217
}
209218
}
-247 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)