Skip to content

Commit 6d10eb1

Browse files
committed
install.md done!
1 parent e69305d commit 6d10eb1

File tree

3 files changed

+111
-44
lines changed

3 files changed

+111
-44
lines changed

INSTALL.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,73 @@ az-firewall-mon once installed in your environment will result in the following
77
The steps to follow to install a private copy of az-firewall-mon in your environment are:
88

99
* Fork the GitHub repository
10+
* Create a GitHub Personal Access Token (PAT)
1011
* Create all Azure resources
1112
* Configure the GitHub Action to deploy both the SPA and the backend API
1213
* Environment variables
1314

1415
# Fork the GitHub repository
1516

16-
The first thing to do is clone the az-firewall-mon repository; this repository holds all the source code of az-firewall-mon. This will also allow to pull down and build the latest changes and updates from original repo having the stability of maintaining a own personal copy.
17+
The first thing to do is clone the az-firewall-mon repository. This will also allow you to pull down and build the latest changes and updates from the original repo while having the stability of maintaining your own personal copy.
1718

1819
* Navigate to: <https://github.com/nicolgit/azure-firewall-mon>.
1920
* Click Fork > create a new fork (top right of the repository)
2021
* Click [Create fork]
21-
* You have now a fork of the 'az-firewall-mon' repository; when a new update comes out - you can also select 'Sync fork' - to keep your fork up-to-date and trigger a new build.
2222

23+
> You have now a fork of the 'az-firewall-mon' repository; when a new update comes out - you can also select 'Sync fork' - to keep your fork up-to-date and trigger a new build.
24+
25+
# Create a GitHub Personal Access Token (PAT)
26+
27+
1. Go to your GitHub account settings
28+
2. Select **Developer settings** > **Personal access tokens** > **Tokens (classic)** (<https://github.com/settings/tokens>)
29+
3. Click **Generate new token** > **Generate new token (classic)**
30+
4. Give your token a name like "Azure Static Web App Deployment"
31+
5. Expiration: `No Expiration`
32+
6. Select the following scopes:
33+
- `repo` (Full control of private repositories)
34+
- `workflow` (Update GitHub Action workflows)
35+
7. Click **Generate token**
36+
8. **Copy your token** (you won't be able to see it again)
2337

2438
# Create all Azure resources
25-
An instance of az-firewall-mon is composeb by
39+
An instance of `az-firewall-mon` is composed of:
2640
* 1 Azure Static Web App (standard plan)
27-
* 1 Azure Map account
41+
* 1 Azure Maps account
2842
* 1 Azure OpenAI account
29-
* 1 Application insight instance
43+
* 1 Application Insights instance
3044

31-
All these resources can be deployed on your subscription clicking the button below:
45+
All these resources can be deployed to your subscription by clicking the button below:
3246

3347
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fnicolgit%2Fazure-firewall-mon%2Fmain%2Fbicep%2Fsetup.json)
3448

35-
# Configure the GitHub Action to deploy both the SPA and the backend API
49+
Remember to fill in the following parameters:
50+
- `staticWebAppName`: Name for your static web app
51+
- `repositoryUrl`: Your GitHub repository URL (e.g., `https://github.com/username/azure-firewall-mon`)
52+
- `repositoryToken`: Your GitHub PAT created in the above paragraph
53+
- `branch`: Your main branch ('main')
54+
55+
This will create an action in your repository that will build and deploy the solution to Azure.
56+
57+
Go to <https://github.com/YOURGITHUBACCOUNT/azure-firewall-mon/actions> to see the deployment status. When deployment is complete, go to Azure Portal > Static Web Apps > View app in browser
58+
59+
# Environment variables
60+
61+
az-firewall-mon requires a few environment variables to work. These variables are configured automatically by the deployment. Here's the reference in case you want to change any:
62+
63+
APPLICATIONINSIGHTS_CONNECTION_STRING: Application Insights connection string
64+
65+
Azure Maps settings
66+
* **ip_api_key**: Azure Maps API key
67+
* **ip_throttling_calls**: '1'
68+
* **ip_throttling_window_milliseconds**: '1000'
3669

70+
IP API will return a 429 status code if you make more than 1 call to IP API per second (1000 milliseconds)
3771

72+
Azure OpenAI settings
73+
* **aoai_api_key**: Azure OpenAI key
74+
* **aoai_endpoint**: Azure OpenAI endpoint
75+
* **aoai_deployment**: Azure OpenAI deployment name
3876

39-
# Environment variables
77+
* **llm_throttling_calls**: '5'
78+
* **llm_throttling_window_milliseconds**: '60000'
79+
Chat API will return a 429 status code if you make more than 5 calls per minute (60000 milliseconds)

bicep/setup.bicep

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
@description('Name of the Static Web App')
22
param staticWebAppName string = 'my-firewall-mon-web'
33

4+
@description('GitHub repository URL for the Static Web App')
5+
param repositoryUrl string
6+
7+
@description('GitHub repository token for the Static Web App deployment')
8+
@secure()
9+
param repositoryToken string
10+
11+
@description('GitHub repository branch for the Static Web App deployment')
12+
param branch string = 'main'
13+
414
@description('Name of the Application Insights instance')
515
param appInsightsName string = 'firewall-mon-insights'
616

717
@description('Name of the Azure Maps Account')
8-
param mapsAccountName string = 'firewall-mon-maps'
18+
param mapsAccountName string = 'firewall-mon-maps-${uniqueString(resourceGroup().id)}'
919

1020
@description('Name of the Azure OpenAI Account')
11-
param openAiAccountName string = 'firewall-mon-openai'
21+
param openAiAccountName string = 'firewall-mon-openai-${uniqueString(resourceGroup().id)}'
1222

1323
@description('Name of the GPT-4o model deployment')
1424
param gpt4oDeploymentName string = 'gpt4o'
@@ -29,6 +39,7 @@ param retentionInDays int = 90
2939
@allowed(['PerGB2018', 'Free', 'PerNode', 'Standard', 'Standalone', 'Premium'])
3040
param logAnalyticsSku string = 'PerGB2018'
3141

42+
3243
resource staticWebApp 'Microsoft.Web/staticSites@2023-01-01' = {
3344
name: staticWebAppName
3445
location: resourceGroup().location
@@ -37,8 +48,15 @@ resource staticWebApp 'Microsoft.Web/staticSites@2023-01-01' = {
3748
tier: 'Standard'
3849
}
3950
properties: {
40-
51+
repositoryUrl: repositoryUrl
52+
repositoryToken: repositoryToken
53+
branch: branch
54+
buildProperties: {
55+
appLocation: '/firewall-mon-app'
56+
apiLocation: '/firewall-mon-api'
57+
outputLocation: 'dist/firewall-mon-app'
4158
}
59+
}
4260
}
4361

4462
// Create Static Web App App Settings with Application Insights connection string
@@ -60,7 +78,7 @@ resource staticWebAppSettings 'Microsoft.Web/staticSites/config@2023-01-01' = {
6078
aoai_deployment: gpt4oDeploymentName
6179

6280
llm_throttling_calls: '5'
63-
llm_throttling_window_milliseconds: '1000'
81+
llm_throttling_window_milliseconds: '60000'
6482

6583
// Build date timestamp
6684
BUILD_DATE: baseTime
@@ -123,27 +141,20 @@ resource openAiAccount 'Microsoft.CognitiveServices/accounts@2024-10-01' = {
123141
}
124142
}
125143

126-
// Create GPT-4o model deployment
127144
resource gpt4oDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01' = {
128145
parent: openAiAccount
129146
name: gpt4oDeploymentName
130147
sku: {
131148
name: 'Standard'
132-
capacity: 1 // Represents the amount of provisioned throughput
149+
capacity: 10
133150
}
134151
properties: {
135152
model: {
136153
format: 'OpenAI'
137154
name: 'gpt-4o'
138155
version: '2024-11-20' // Using the latest version available
139156
}
157+
raiPolicyName: 'Microsoft.Default'
158+
versionUpgradeOption: 'OnceNewDefaultVersionAvailable'
140159
}
141160
}
142-
143-
// Output the Maps Account id for reference
144-
output mapsAccountId string = mapsAccount.id
145-
146-
// Output Azure OpenAI account endpoint and deployment ID
147-
output openAiEndpoint string = openAiAccount.properties.endpoint
148-
output openAiDeploymentId string = gpt4oDeployment.id
149-

bicep/setup.json

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.36.1.42791",
8-
"templateHash": "8888054241536279544"
8+
"templateHash": "14750720778315896797"
99
}
1010
},
1111
"parameters": {
@@ -16,6 +16,25 @@
1616
"description": "Name of the Static Web App"
1717
}
1818
},
19+
"repositoryUrl": {
20+
"type": "string",
21+
"metadata": {
22+
"description": "GitHub repository URL for the Static Web App"
23+
}
24+
},
25+
"repositoryToken": {
26+
"type": "securestring",
27+
"metadata": {
28+
"description": "GitHub repository token for the Static Web App deployment"
29+
}
30+
},
31+
"branch": {
32+
"type": "string",
33+
"defaultValue": "main",
34+
"metadata": {
35+
"description": "GitHub repository branch for the Static Web App deployment"
36+
}
37+
},
1938
"appInsightsName": {
2039
"type": "string",
2140
"defaultValue": "firewall-mon-insights",
@@ -25,14 +44,14 @@
2544
},
2645
"mapsAccountName": {
2746
"type": "string",
28-
"defaultValue": "firewall-mon-maps",
47+
"defaultValue": "[format('firewall-mon-maps-{0}', uniqueString(resourceGroup().id))]",
2948
"metadata": {
3049
"description": "Name of the Azure Maps Account"
3150
}
3251
},
3352
"openAiAccountName": {
3453
"type": "string",
35-
"defaultValue": "firewall-mon-openai",
54+
"defaultValue": "[format('firewall-mon-openai-{0}', uniqueString(resourceGroup().id))]",
3655
"metadata": {
3756
"description": "Name of the Azure OpenAI Account"
3857
}
@@ -98,7 +117,16 @@
98117
"name": "Standard",
99118
"tier": "Standard"
100119
},
101-
"properties": {}
120+
"properties": {
121+
"repositoryUrl": "[parameters('repositoryUrl')]",
122+
"repositoryToken": "[parameters('repositoryToken')]",
123+
"branch": "[parameters('branch')]",
124+
"buildProperties": {
125+
"appLocation": "/firewall-mon-app",
126+
"apiLocation": "/firewall-mon-api",
127+
"outputLocation": "dist/firewall-mon-app"
128+
}
129+
}
102130
},
103131
{
104132
"type": "Microsoft.Web/staticSites/config",
@@ -113,7 +141,7 @@
113141
"aoai_endpoint": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('openAiAccountName')), '2024-10-01').endpoint]",
114142
"aoai_deployment": "[parameters('gpt4oDeploymentName')]",
115143
"llm_throttling_calls": "5",
116-
"llm_throttling_window_milliseconds": "1000",
144+
"llm_throttling_window_milliseconds": "60000",
117145
"BUILD_DATE": "[parameters('baseTime')]"
118146
},
119147
"dependsOn": [
@@ -186,32 +214,20 @@
186214
"name": "[format('{0}/{1}', parameters('openAiAccountName'), parameters('gpt4oDeploymentName'))]",
187215
"sku": {
188216
"name": "Standard",
189-
"capacity": 1
217+
"capacity": 10
190218
},
191219
"properties": {
192220
"model": {
193221
"format": "OpenAI",
194222
"name": "gpt-4o",
195223
"version": "2024-11-20"
196-
}
224+
},
225+
"raiPolicyName": "Microsoft.Default",
226+
"versionUpgradeOption": "OnceNewDefaultVersionAvailable"
197227
},
198228
"dependsOn": [
199229
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('openAiAccountName'))]"
200230
]
201231
}
202-
],
203-
"outputs": {
204-
"mapsAccountId": {
205-
"type": "string",
206-
"value": "[resourceId('Microsoft.Maps/accounts', parameters('mapsAccountName'))]"
207-
},
208-
"openAiEndpoint": {
209-
"type": "string",
210-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('openAiAccountName')), '2024-10-01').endpoint]"
211-
},
212-
"openAiDeploymentId": {
213-
"type": "string",
214-
"value": "[resourceId('Microsoft.CognitiveServices/accounts/deployments', parameters('openAiAccountName'), parameters('gpt4oDeploymentName'))]"
215-
}
216-
}
232+
]
217233
}

0 commit comments

Comments
 (0)