From 609e381ceb8b97df43dba5fd0e675b2e93aebfd6 Mon Sep 17 00:00:00 2001 From: hellikopter Date: Tue, 18 Dec 2018 11:59:35 +0000 Subject: [PATCH] changes to app settings (catch up with .net core move) --- Deployment/AppService.json | 56 ++++++--------------------------- Deployment/PhotoAPISettings.ps1 | 4 +-- 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/Deployment/AppService.json b/Deployment/AppService.json index f0364b2..e793318 100644 --- a/Deployment/AppService.json +++ b/Deployment/AppService.json @@ -11,19 +11,7 @@ "applicationPlanName": { "type": "string", "metadata": { - "description": "Name of the Application Insights." - } - }, - "operationsResourceGroupName": { - "type": "string", - "metadata": { - "description": "Name of the Resource Group where backup storage is." - } - }, - "applicationInsightsName": { - "type": "string", - "metadata": { - "description": "Name of the Application Insights." + "description": "Name of the Application plan." } }, "photoStorageAccountEndpoint": { @@ -38,12 +26,6 @@ "description": "Connection string for cache Azure Storage (should be r/w SAS)." } }, - "photoNotFoundImageId": { - "type": "string", - "metadata": { - "description": "Id of the default image." - } - }, "apiManagementIP": { "type": "string", "metadata": { @@ -131,35 +113,15 @@ ], "properties": { "WEBSITE_NODE_DEFAULT_VERSION": "6.9.1", - "ApplicationInsightsInstrumentationKey": "[reference(resourceId(subscription().subscriptionId,parameters('operationsResourceGroupName'),'Microsoft.Insights/Components',parameters('applicationInsightsName')),'2014-04-01').InstrumentationKey]", - "NotFoundImageId": "[parameters('photoNotFoundImageId')]", - "SubscriptionKey": "", - "ApiVersion": "" - } - }, - { - "comments": "Connection strings used by the App", - "apiVersion": "2015-08-01", - "name": "connectionstrings", - "type": "config", - "dependsOn": [ - "[resourceId('Microsoft.Web/sites', parameters('photoAPIName'))]" - ], - "properties": { - "PhotoStorage": { - "value": "[parameters('photoStorageAccountEndpoint')]", - "type": "Custom" - }, - "PhotoCache": { - "value": "[parameters('photoCacheAccountEndpoint')]", - "type": "Custom" - }, - "FixedQuery": { - "value": "https://api.parliament.uk/query/", - "type": "Custom" - } + "Cache__ConnectionString": "[parameters('photoCacheAccountEndpoint')]", + "Cache__Container": "cache", + "Storage__ConnectionString": "[parameters('photoStorageAccountEndpoint')]", + "Storage__Container": "photo", + "Query__Endpoint": "https://api.parliament.uk/query/", + "Query__SubscriptionKey": "", + "Query__ApiVersion": "" } - } + } ], "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', parameters('applicationPlanName'))]" diff --git a/Deployment/PhotoAPISettings.ps1 b/Deployment/PhotoAPISettings.ps1 index 545a840..2dfa5d1 100644 --- a/Deployment/PhotoAPISettings.ps1 +++ b/Deployment/PhotoAPISettings.ps1 @@ -40,8 +40,8 @@ foreach($set in $webAppSettings){ } Log "Sets new settings" -$settings["SubscriptionKey"]=$subscription.PrimaryKey -$settings["ApiVersion"]=$APIPrefix +$settings["Query__SubscriptionKey"]=$subscription.PrimaryKey +$settings["Query__ApiVersion"]=$APIPrefix Set-AzureRmWebApp -ResourceGroupName $APIResourceGroupName -Name $PhotoAPIName -AppSettings $settings