Skip to content

Commit

Permalink
Merge pull request #110 from newrelic/remove_contentshare_when_privat…
Browse files Browse the repository at this point in the history
…e_connectivity

Removes Content Share when using private Storage Account connectivity
  • Loading branch information
nr-rkallempudi authored Sep 13, 2024
2 parents 1ea491b + ff77c00 commit b2f1c86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 55 deletions.
29 changes: 2 additions & 27 deletions armTemplates/azuredeploy-blobforwarder.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"contentVersion": "1.1.0.0",
"parameters": {
"newRelicLicenseKey": {
"type": "string",
Expand Down Expand Up @@ -98,9 +98,6 @@
"privateEndpointPrivateDnsZoneGroupsStorageTableName": "[format('{0}/{1}', variables('privateEndpointStorageTableName'), 'tablePrivateDnsZoneGroup')]",
"privateEndpointPrivateDnsZoneGroupsStorageQueueName": "[format('{0}/{1}', variables('privateEndpointStorageQueueName'), 'queuePrivateDnsZoneGroup')]",

"functionContentShareName": "[format('{0}-content-share', variables('functionAppName'))]",
"storageAccountFileShareName": "[format('{0}/default/{1}', variables('internalStorageAccountName'), variables('functionContentShareName'))]",

"functionNetworkConfigName": "[format('{0}/{1}', variables('functionAppName'), 'virtualNetwork')]"
},
"resources": [
Expand Down Expand Up @@ -443,15 +440,6 @@
"networkAcls": "[if(parameters('disablePublicAccessToStorageAccount'), json('{\"bypass\": \"None\", \"defaultAction\": \"Deny\"}'), json('null'))]"
}
},
{
"condition": "[parameters('disablePublicAccessToStorageAccount')]",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"apiVersion": "2022-05-01",
"name": "[variables('storageAccountFileShareName')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('internalStorageAccountName'))]"
]
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-09-01",
Expand All @@ -477,8 +465,7 @@
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageBlobDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageFileDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageQueueDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageTableDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', variables('internalStorageAccountName'), 'default', variables('functionContentShareName'))]"
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageTableDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]",
Expand Down Expand Up @@ -512,10 +499,6 @@
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('internalStorageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('internalStorageAccountName')), '2021-04-01').keys[0].value,';EndpointSuffix=',environment().suffixes.storage)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('internalStorageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('internalStorageAccountName')), '2021-04-01').keys[0].value,';EndpointSuffix=',environment().suffixes.storage)]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "node"
Expand All @@ -528,14 +511,6 @@
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~4"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[variables('functionContentShareName')]"
},
{
"name": "WEBSITE_CONTENTOVERVNET",
"value": "[if(parameters('disablePublicAccessToStorageAccount'), '1', '0')]"
},
{
"name": "WEBSITE_RUN_FROM_PACKAGE",
"value": "[if(parameters('disablePublicAccessToStorageAccount'), variables('blobForwarderFunctionArtifact'),'0')]"
Expand Down
29 changes: 2 additions & 27 deletions armTemplates/azuredeploy-eventhubforwarder.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"contentVersion": "1.1.0.0",
"parameters": {
"newRelicLicenseKey": {
"type": "string",
Expand Down Expand Up @@ -166,9 +166,6 @@
"privateEndpointPrivateDnsZoneGroupsStorageTableName": "[format('{0}/{1}', variables('privateEndpointStorageTableName'), 'tablePrivateDnsZoneGroup')]",
"privateEndpointPrivateDnsZoneGroupsStorageQueueName": "[format('{0}/{1}', variables('privateEndpointStorageQueueName'), 'queuePrivateDnsZoneGroup')]",

"functionContentShareName": "[format('{0}-content-share', variables('functionAppName'))]",
"storageAccountFileShareName": "[format('{0}/default/{1}', variables('storageAccountName'), variables('functionContentShareName'))]",

"functionNetworkConfigName": "[format('{0}/{1}', variables('functionAppName'), 'virtualNetwork')]"
},
"resources": [
Expand Down Expand Up @@ -575,15 +572,6 @@
"networkAcls": "[if(parameters('disablePublicAccessToStorageAccount'), json('{\"bypass\": \"None\", \"defaultAction\": \"Deny\"}'), json('null'))]"
}
},
{
"condition": "[parameters('disablePublicAccessToStorageAccount')]",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"apiVersion": "2022-05-01",
"name": "[variables('storageAccountFileShareName')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-09-01",
Expand All @@ -609,8 +597,7 @@
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageBlobDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageFileDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageQueueDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageTableDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]",
"[resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', variables('storageAccountName'), 'default', variables('functionContentShareName'))]"
"[resourceId('Microsoft.Network/privateDnsZones/virtualNetworkLinks', variables('privateStorageTableDnsZoneName'), format('{0}-link', variables('virtualNetworkName')))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]",
Expand Down Expand Up @@ -664,18 +651,6 @@
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2021-04-01').keys[0].value,';EndpointSuffix=',environment().suffixes.storage)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listkeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2021-04-01').keys[0].value,';EndpointSuffix=',environment().suffixes.storage)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[variables('functionContentShareName')]"
},
{
"name": "WEBSITE_CONTENTOVERVNET",
"value": "[if(parameters('disablePublicAccessToStorageAccount'), '1', '0')]"
},
{
"name": "WEBSITE_RUN_FROM_PACKAGE",
"value": "[if(parameters('disablePublicAccessToStorageAccount'), variables('eventHubForwarderFunctionArtifact'),'0')]"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newrelic-azure-functions",
"version": "2.5.0",
"version": "2.5.1",
"description": "This repository contains functions to collect and forward logs from Microsoft Azure Blob Storage and Event Hubs.",
"scripts": {
"lint": "eslint ./**/*.js",
Expand Down

0 comments on commit b2f1c86

Please sign in to comment.