Files
Maor LegerandGitHub a951f242be Electron sample (#12960)
## What

Add an Electron sample that integrates with multiple Azure services.

## Why

As part of our investigation into how well our SDKs integrate into existing
frameworks we created a few sample apps that showcase how to use the
various SDKs. Adding a sample here would ensure that we have something
to reference and provide to folks who are interested in using our SDKs in Electron.
2020-12-23 15:51:56 -08:00

155 lines
4.7 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name."
}
},
"origin": {
"type": "string",
"defaultValue": "http://localhost:3000",
"metadata": {
"description": "The application origin for configuring CORS policies. By default it'll be set to http://localhost:3000 locally."
}
}
},
"variables": {
"eventHubsName": "events",
"eventHubsNamespace": "[concat(parameters('baseName'), 'reactevents')]",
"storageAccount": "[concat(replace(parameters('baseName'), '-', ''), 'reactstorage')]",
"storageContainer": "[concat(replace(parameters('baseName'), '-', ''), 'reactstorage', '/default/blobs')]",
"location": "[resourceGroup().location]"
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces",
"apiVersion": "2018-01-01-preview",
"name": "[variables('eventHubsNamespace')]",
"location": "[variables('location')]",
"sku": {
"name": "Basic",
"tier": "Basic",
"capacity": 1
},
"properties": {
"zoneRedundant": false,
"isAutoInflateEnabled": false,
"maximumThroughputUnits": 0,
"kafkaEnabled": false
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2020-08-01-preview",
"name": "[variables('storageAccount')]",
"location": "[variables('location')]",
"sku": {
"name": "Standard_RAGRS",
"tier": "Standard"
},
"kind": "StorageV2",
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
}
},
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2017-04-01",
"name": "[concat(variables('eventHubsNamespace'), '/', variables('eventHubsName'))]",
"location": "[variables('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubsNamespace'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 2,
"status": "Active"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2020-08-01-preview",
"name": "[concat(variables('storageAccount'), '/default')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount'))]"
],
"sku": {
"name": "Standard_RAGRS",
"tier": "Standard"
},
"properties": {
"cors": {
"corsRules": [
{
"allowedOrigins": ["[parameters('origin')]"],
"allowedMethods": ["GET", "OPTIONS", "PUT", "POST"],
"maxAgeInSeconds": 0,
"exposedHeaders": ["*"],
"allowedHeaders": ["*"]
}
]
},
"deleteRetentionPolicy": {
"enabled": false
}
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2020-08-01-preview",
"name": "[variables('storageContainer')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/blobServices', variables('storageAccount'), 'default')]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount'))]"
],
"properties": {
"defaultEncryptionScope": "$account-encryption-key",
"denyEncryptionScopeOverride": false,
"publicAccess": "None"
}
}
],
"outputs": {
"react_app_event_hubs_namespace": {
"type": "string",
"value": "[concat(variables('eventHubsNamespace'), '.servicebus.windows.net')]"
},
"react_app_event_hubs_name": {
"type": "string",
"value": "[variables('eventHubsName')]"
},
"react_app_blob_uri": {
"type": "string",
"value": "[reference(variables('storageAccount')).primaryEndpoints.blob]"
},
"react_app_blob_container": {
"type": "string",
"value": "[last(split(variables('storageContainer'), '/'))]"
}
}
}