|
1 | 1 | {
|
2 |
| - "parameters": { |
3 |
| - "logAnalyticsWorkspaceId": { |
4 |
| - "metadata": { |
5 |
| - "description": "The Id of the Log Analytics workspace. In the portal, you find this under Settings -> Agents -> Windows/Linux Servers -> Agent Instructions." |
6 |
| - }, |
7 |
| - "type": "string" |
8 |
| - }, |
9 |
| - "imageName": { |
10 |
| - "defaultValue": "ghcr.io/clemensv/real-time-sources-mode-s:latest", |
11 |
| - "metadata": { |
12 |
| - "description": "The name of the container image." |
13 |
| - }, |
14 |
| - "type": "string" |
15 |
| - }, |
16 |
| - "logAnalyticsWorkspaceKey": { |
17 |
| - "metadata": { |
18 |
| - "description": "The primary or secondary key of the Log Analytics workspace. In the portal, you find this under Settings -> Agents -> Windows/Linux Servers -> Agent Instructions." |
19 |
| - }, |
20 |
| - "type": "securestring" |
21 |
| - }, |
22 |
| - "connectionStringSecret": { |
23 |
| - "metadata": { |
24 |
| - "description": "The Microsoft Fabric Event Stream custom input endpoint or Azure Event Hubs connection string." |
25 |
| - }, |
26 |
| - "type": "securestring" |
27 |
| - }, |
28 |
| - "feedUrls": { |
29 |
| - "defaultValue": "", |
30 |
| - "metadata": { |
31 |
| - "description": "Comma-separated list of feed URLs (RSS or OPML)" |
32 |
| - }, |
33 |
| - "type": "string" |
34 |
| - }, |
35 |
| - "appName": { |
36 |
| - "defaultValue": "[if(empty(resourceGroup().name), 'mode-s', resourceGroup().name)]", |
37 |
| - "maxLength": 64, |
38 |
| - "metadata": { |
39 |
| - "description": "The name of the container instance." |
40 |
| - }, |
41 |
| - "type": "string" |
42 |
| - } |
43 |
| - }, |
44 | 2 | "variables": {
|
45 |
| - "fileShareName": "fileshare", |
46 |
| - "storageAccountName": "[concat(replace(parameters('appName'), '-', ''), 'stg')]" |
| 3 | + "storageAccountName": "[concat(replace(parameters('appName'), '-', ''), 'stg')]", |
| 4 | + "fileShareName": "fileshare" |
47 | 5 | },
|
48 |
| - "contentVersion": "1.0.0.0", |
49 | 6 | "resources": [
|
50 | 7 | {
|
| 8 | + "sku": { |
| 9 | + "name": "Standard_LRS" |
| 10 | + }, |
51 | 11 | "location": "[resourceGroup().location]",
|
52 |
| - "type": "Microsoft.Storage/storageAccounts", |
| 12 | + "name": "[variables('storageAccountName')]", |
| 13 | + "kind": "StorageV2", |
53 | 14 | "properties": {
|
54 | 15 | "accessTier": "Hot"
|
55 | 16 | },
|
56 |
| - "kind": "StorageV2", |
57 | 17 | "apiVersion": "2021-04-01",
|
58 |
| - "name": "[variables('storageAccountName')]", |
59 |
| - "sku": { |
60 |
| - "name": "Standard_LRS" |
61 |
| - } |
| 18 | + "type": "Microsoft.Storage/storageAccounts" |
62 | 19 | },
|
63 | 20 | {
|
64 | 21 | "location": "[resourceGroup().location]",
|
65 |
| - "type": "Microsoft.Storage/storageAccounts/fileServices", |
| 22 | + "name": "[concat(variables('storageAccountName'), '/default/')]", |
66 | 23 | "properties": {
|
67 | 24 | "protocolSettings": {
|
68 | 25 | "smb": {
|
69 | 26 | "enabled": true
|
70 | 27 | }
|
71 | 28 | }
|
72 | 29 | },
|
| 30 | + "apiVersion": "2021-04-01", |
73 | 31 | "dependsOn": [
|
74 | 32 | "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
|
75 | 33 | ],
|
76 |
| - "apiVersion": "2021-04-01", |
77 |
| - "name": "[concat(variables('storageAccountName'), '/default/')]" |
| 34 | + "type": "Microsoft.Storage/storageAccounts/fileServices" |
78 | 35 | },
|
79 | 36 | {
|
80 | 37 | "location": "[resourceGroup().location]",
|
81 |
| - "type": "Microsoft.Storage/storageAccounts/fileServices/shares", |
| 38 | + "name": "[concat(variables('storageAccountName'), '/default/', variables('fileShareName'))]", |
82 | 39 | "properties": {
|
83 | 40 | "shareQuota": 5120
|
84 | 41 | },
|
| 42 | + "apiVersion": "2021-04-01", |
85 | 43 | "dependsOn": [
|
86 | 44 | "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
|
87 | 45 | ],
|
88 |
| - "apiVersion": "2021-04-01", |
89 |
| - "name": "[concat(variables('storageAccountName'), '/default/', variables('fileShareName'))]" |
| 46 | + "type": "Microsoft.Storage/storageAccounts/fileServices/shares" |
90 | 47 | },
|
91 | 48 | {
|
92 |
| - "name": "[parameters('appName')]", |
| 49 | + "apiVersion": "2021-09-01", |
93 | 50 | "location": "[resourceGroup().location]",
|
94 | 51 | "properties": {
|
| 52 | + "volumes": [ |
| 53 | + { |
| 54 | + "azureFile": { |
| 55 | + "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value]", |
| 56 | + "shareName": "[variables('fileShareName')]", |
| 57 | + "storageAccountName": "[variables('storageAccountName')]" |
| 58 | + }, |
| 59 | + "name": "azurefilevolume" |
| 60 | + } |
| 61 | + ], |
| 62 | + "restartPolicy": "Always", |
| 63 | + "osType": "Linux", |
| 64 | + "diagnostics": { |
| 65 | + "logAnalytics": { |
| 66 | + "workspaceId": "[parameters('logAnalyticsWorkspaceId')]", |
| 67 | + "workspaceKey": "[parameters('logAnalyticsWorkspaceKey')]" |
| 68 | + } |
| 69 | + }, |
95 | 70 | "containers": [
|
96 | 71 | {
|
97 |
| - "name": "[parameters('appName')]", |
98 | 72 | "properties": {
|
99 |
| - "image": "[parameters('imageName')]", |
| 73 | + "resources": { |
| 74 | + "requests": { |
| 75 | + "memoryInGB": 1, |
| 76 | + "cpu": 0.5 |
| 77 | + } |
| 78 | + }, |
100 | 79 | "volumeMounts": [
|
101 | 80 | {
|
102 |
| - "name": "azurefilevolume", |
103 |
| - "mountPath": "/mnt/fileshare" |
| 81 | + "mountPath": "/mnt/fileshare", |
| 82 | + "name": "azurefilevolume" |
104 | 83 | }
|
105 | 84 | ],
|
| 85 | + "image": "[parameters('imageName')]", |
106 | 86 | "environmentVariables": [
|
107 | 87 | {
|
108 |
| - "name": "CONNECTION_STRING", |
109 |
| - "secureValue": "[parameters('connectionStringSecret')]" |
| 88 | + "value": "[parameters('dump1090Host')]", |
| 89 | + "name": "DUMP1090_HOST" |
110 | 90 | },
|
111 | 91 | {
|
112 |
| - "name": "LOG_LEVEL", |
113 |
| - "value": "INFO" |
| 92 | + "value": "[parameters('dump1090Port')]", |
| 93 | + "name": "DUMP1090_PORT" |
114 | 94 | },
|
115 | 95 | {
|
116 |
| - "name": "USGS_LAST_POLLED_FILE", |
117 |
| - "value": "/mnt/fileshare/usgs_last_polled.json" |
118 |
| - } |
119 |
| - ], |
120 |
| - "resources": { |
121 |
| - "requests": { |
122 |
| - "memoryInGB": 1, |
123 |
| - "cpu": 0.5 |
| 96 | + "value": "[parameters('refLat')]", |
| 97 | + "name": "REF_LAT" |
| 98 | + }, |
| 99 | + { |
| 100 | + "value": "[parameters('refLon')]", |
| 101 | + "name": "REF_LON" |
| 102 | + }, |
| 103 | + { |
| 104 | + "value": "[parameters('stationId')]", |
| 105 | + "name": "STATIONID" |
| 106 | + }, |
| 107 | + { |
| 108 | + "secureValue": "[parameters('connectionStringSecret')]", |
| 109 | + "name": "CONNECTION_STRING" |
| 110 | + }, |
| 111 | + { |
| 112 | + "value": "[parameters('kafkaBootstrapServers')]", |
| 113 | + "name": "KAFKA_BOOTSTRAP_SERVERS" |
| 114 | + }, |
| 115 | + { |
| 116 | + "value": "[parameters('kafkaTopic')]", |
| 117 | + "name": "KAFKA_TOPIC" |
| 118 | + }, |
| 119 | + { |
| 120 | + "value": "[parameters('saslUsername')]", |
| 121 | + "name": "SASL_USERNAME" |
| 122 | + }, |
| 123 | + { |
| 124 | + "secureValue": "[parameters('saslPassword')]", |
| 125 | + "name": "SASL_PASSWORD" |
| 126 | + }, |
| 127 | + { |
| 128 | + "value": "[parameters('pollingInterval')]", |
| 129 | + "name": "POLLING_INTERVAL" |
| 130 | + }, |
| 131 | + { |
| 132 | + "value": "[parameters('logLevel')]", |
| 133 | + "name": "LOG_LEVEL" |
124 | 134 | }
|
125 |
| - } |
126 |
| - } |
127 |
| - } |
128 |
| - ], |
129 |
| - "restartPolicy": "Always", |
130 |
| - "diagnostics": { |
131 |
| - "logAnalytics": { |
132 |
| - "workspaceKey": "[parameters('logAnalyticsWorkspaceKey')]", |
133 |
| - "workspaceId": "[parameters('logAnalyticsWorkspaceId')]" |
| 135 | + ] |
| 136 | + }, |
| 137 | + "name": "[parameters('appName')]" |
134 | 138 | }
|
135 |
| - }, |
136 |
| - "volumes": [ |
137 |
| - { |
138 |
| - "name": "azurefilevolume", |
139 |
| - "azureFile": { |
140 |
| - "shareName": "[variables('fileShareName')]", |
141 |
| - "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value]", |
142 |
| - "storageAccountName": "[variables('storageAccountName')]" |
143 |
| - } |
144 |
| - } |
145 |
| - ], |
146 |
| - "osType": "Linux" |
| 139 | + ] |
147 | 140 | },
|
148 | 141 | "type": "Microsoft.ContainerInstance/containerGroups",
|
149 |
| - "apiVersion": "2021-09-01" |
| 142 | + "name": "[parameters('appName')]" |
150 | 143 | }
|
151 | 144 | ],
|
152 |
| - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" |
| 145 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
| 146 | + "contentVersion": "1.0.0.0", |
| 147 | + "parameters": { |
| 148 | + "dump1090Port": { |
| 149 | + "metadata": { |
| 150 | + "description": "TCP port dump1090 listens on." |
| 151 | + }, |
| 152 | + "type": "string", |
| 153 | + "defaultValue": "30005" |
| 154 | + }, |
| 155 | + "stationId": { |
| 156 | + "metadata": { |
| 157 | + "description": "Station ID for event source attribution." |
| 158 | + }, |
| 159 | + "type": "string", |
| 160 | + "defaultValue": "station1" |
| 161 | + }, |
| 162 | + "dump1090Host": { |
| 163 | + "metadata": { |
| 164 | + "description": "Hostname or IP address of dump1090." |
| 165 | + }, |
| 166 | + "type": "string", |
| 167 | + "defaultValue": "localhost" |
| 168 | + }, |
| 169 | + "logAnalyticsWorkspaceId": { |
| 170 | + "metadata": { |
| 171 | + "description": "The Id of the Log Analytics workspace. In the portal, you find this under Settings -> Agents -> Windows/Linux Servers -> Agent Instructions." |
| 172 | + }, |
| 173 | + "type": "string" |
| 174 | + }, |
| 175 | + "saslPassword": { |
| 176 | + "metadata": { |
| 177 | + "description": "Password for SASL authentication." |
| 178 | + }, |
| 179 | + "type": "securestring" |
| 180 | + }, |
| 181 | + "connectionStringSecret": { |
| 182 | + "metadata": { |
| 183 | + "description": "The Microsoft Fabric Event Stream custom input endpoint or Azure Event Hubs connection string." |
| 184 | + }, |
| 185 | + "type": "securestring" |
| 186 | + }, |
| 187 | + "imageName": { |
| 188 | + "metadata": { |
| 189 | + "description": "The name of the container image." |
| 190 | + }, |
| 191 | + "type": "string", |
| 192 | + "defaultValue": "ghcr.io/clemensv/real-time-sources-mode-s:latest" |
| 193 | + }, |
| 194 | + "refLat": { |
| 195 | + "metadata": { |
| 196 | + "description": "Latitude of the receiving antenna." |
| 197 | + }, |
| 198 | + "type": "string", |
| 199 | + "defaultValue": "0" |
| 200 | + }, |
| 201 | + "refLon": { |
| 202 | + "metadata": { |
| 203 | + "description": "Longitude of the receiving antenna." |
| 204 | + }, |
| 205 | + "type": "string", |
| 206 | + "defaultValue": "0" |
| 207 | + }, |
| 208 | + "saslUsername": { |
| 209 | + "metadata": { |
| 210 | + "description": "Username for SASL authentication." |
| 211 | + }, |
| 212 | + "type": "string", |
| 213 | + "defaultValue": "" |
| 214 | + }, |
| 215 | + "logLevel": { |
| 216 | + "metadata": { |
| 217 | + "description": "Logging level." |
| 218 | + }, |
| 219 | + "type": "string", |
| 220 | + "defaultValue": "INFO" |
| 221 | + }, |
| 222 | + "logAnalyticsWorkspaceKey": { |
| 223 | + "metadata": { |
| 224 | + "description": "The primary or secondary key of the Log Analytics workspace. In the portal, you find this under Settings -> Agents -> Windows/Linux Servers -> Agent Instructions." |
| 225 | + }, |
| 226 | + "type": "securestring" |
| 227 | + }, |
| 228 | + "appName": { |
| 229 | + "metadata": { |
| 230 | + "description": "The name of the container instance." |
| 231 | + }, |
| 232 | + "maxLength": 64, |
| 233 | + "type": "string", |
| 234 | + "defaultValue": "[if(empty(resourceGroup().name), 'mode-s', resourceGroup().name)]" |
| 235 | + }, |
| 236 | + "pollingInterval": { |
| 237 | + "metadata": { |
| 238 | + "description": "Polling interval in seconds." |
| 239 | + }, |
| 240 | + "type": "string", |
| 241 | + "defaultValue": "60" |
| 242 | + }, |
| 243 | + "kafkaTopic": { |
| 244 | + "metadata": { |
| 245 | + "description": "Kafka topic to publish messages." |
| 246 | + }, |
| 247 | + "type": "string", |
| 248 | + "defaultValue": "" |
| 249 | + }, |
| 250 | + "kafkaBootstrapServers": { |
| 251 | + "metadata": { |
| 252 | + "description": "Kafka bootstrap servers." |
| 253 | + }, |
| 254 | + "type": "string", |
| 255 | + "defaultValue": "" |
| 256 | + } |
| 257 | + } |
153 | 258 | }
|
0 commit comments