From ac880d01b7ed4820b9f9dc6a1d70a884955bd23f Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Sun, 13 Feb 2022 15:37:40 -0600 Subject: [PATCH] some changes --- .../{Function1.cs => Bookmarks.cs} | 9 +- ...enot-api20220213151332 - Zip Deploy.pubxml | 24 ++++ .../apis1.arm.json | 131 ++++++++++++++++++ .../storage1.arm.json | 70 ++++++++++ ...tmenot-api20220213151332 - Zip Deploy.json | 13 ++ .../Properties/serviceDependencies.json | 6 +- .../Properties/serviceDependencies.local.json | 3 - forgetmenot-api/host.json | 6 - 8 files changed, 246 insertions(+), 16 deletions(-) rename forgetmenot-api/{Function1.cs => Bookmarks.cs} (89%) create mode 100644 forgetmenot-api/Properties/PublishProfiles/forgetmenot-api20220213151332 - Zip Deploy.pubxml create mode 100644 forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/apis1.arm.json create mode 100644 forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/storage1.arm.json create mode 100644 forgetmenot-api/Properties/serviceDependencies.forgetmenot-api20220213151332 - Zip Deploy.json diff --git a/forgetmenot-api/Function1.cs b/forgetmenot-api/Bookmarks.cs similarity index 89% rename from forgetmenot-api/Function1.cs rename to forgetmenot-api/Bookmarks.cs index 12be227..e5dd510 100644 --- a/forgetmenot-api/Function1.cs +++ b/forgetmenot-api/Bookmarks.cs @@ -13,16 +13,16 @@ using Newtonsoft.Json; namespace forgetmenot_api { - public class Function1 + public class Bookmarks { - private readonly ILogger _logger; + private readonly ILogger _logger; - public Function1(ILogger log) + public Bookmarks(ILogger log) { _logger = log; } - [FunctionName("Function1")] + [FunctionName("bookmarks")] [OpenApiOperation(operationId: "Run", tags: new[] { "name" })] [OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)] [OpenApiParameter(name: "name", In = ParameterLocation.Query, Required = true, Type = typeof(string), Description = "The **Name** parameter")] @@ -31,6 +31,7 @@ namespace forgetmenot_api [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req) { _logger.LogInformation("C# HTTP trigger function processed a request."); + _logger.LogInformation("Just log something"); string name = req.Query["name"]; diff --git a/forgetmenot-api/Properties/PublishProfiles/forgetmenot-api20220213151332 - Zip Deploy.pubxml b/forgetmenot-api/Properties/PublishProfiles/forgetmenot-api20220213151332 - Zip Deploy.pubxml new file mode 100644 index 0000000..bc3fe4c --- /dev/null +++ b/forgetmenot-api/Properties/PublishProfiles/forgetmenot-api20220213151332 - Zip Deploy.pubxml @@ -0,0 +1,24 @@ + + + + + $forgetmenot-api20220213151332 + ZipDeploy + AzureWebSite + Release + Any CPU + https://forgetmenot-api20220213151332.azurewebsites.net + False + /subscriptions/dc238150-9fba-4c6a-be71-395acd1749a9/resourcegroups/rg-forgetmenot/providers/Microsoft.Web/sites/forgetmenot-api20220213151332 + <_SavePWD>True + true + /subscriptions/dc238150-9fba-4c6a-be71-395acd1749a9/resourceGroups/rg-forgetmenot/providers/Microsoft.ApiManagement/service/forgetmenot-apiservice/apis/forgetmenot-api + https://forgetmenot-api20220213151332.scm.azurewebsites.net/ + true + net6.0 + false + False + + \ No newline at end of file diff --git a/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/apis1.arm.json b/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/apis1.arm.json new file mode 100644 index 0000000..8440cfa --- /dev/null +++ b/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/apis1.arm.json @@ -0,0 +1,131 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "rg-forgetmenot", + "metadata": { + "_parameterType": "resourceGroup", + "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." + } + }, + "resourceGroupLocation": { + "type": "string", + "defaultValue": "centralus", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource group. Resource groups could have different location than resources." + } + }, + "resourceLocation": { + "type": "string", + "defaultValue": "[parameters('resourceGroupLocation')]", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." + } + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "name": "[parameters('resourceGroupName')]", + "location": "[parameters('resourceGroupLocation')]", + "apiVersion": "2019-10-01" + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('forgetmenot-api', subscription().subscriptionId)))]", + "resourceGroup": "[parameters('resourceGroupName')]", + "apiVersion": "2019-10-01", + "dependsOn": [ + "[parameters('resourceGroupName')]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "name": "forgetmenot-apiservice", + "type": "Microsoft.ApiManagement/service", + "location": "[parameters('resourceLocation')]", + "properties": { + "publisherEmail": "benramey@fastmail.com", + "publisherName": "Ben Ramey", + "notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com", + "hostnameConfigurations": [ + { + "type": "Proxy", + "hostName": "forgetmenot-apiservice.azure-api.net", + "encodedCertificate": null, + "keyVaultId": null, + "certificatePassword": null, + "negotiateClientCertificate": false, + "certificate": null, + "defaultSslBinding": true + } + ], + "publicIPAddresses": null, + "privateIPAddresses": null, + "additionalLocations": null, + "virtualNetworkConfiguration": null, + "customProperties": { + "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False", + "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False", + "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False", + "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False", + "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False", + "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False" + }, + "virtualNetworkType": "None", + "certificates": null, + "apiVersionConstraint": { + "minApiVersion": null + } + }, + "sku": { + "name": "Consumption", + "capacity": 0 + }, + "apiVersion": "2019-12-01" + }, + { + "type": "Microsoft.ApiManagement/service/apis", + "name": "forgetmenot-apiservice/forgetmenot-api", + "properties": { + "displayName": "forgetmenot-api", + "apiRevision": "1", + "description": null, + "subscriptionRequired": true, + "serviceUrl": null, + "path": "", + "protocols": [ + "https" + ], + "authenticationSettings": { + "oAuth2": null, + "openid": null + }, + "subscriptionKeyParameterNames": { + "header": "Ocp-Apim-Subscription-Key", + "query": "subscription-key" + }, + "isCurrent": true + }, + "apiVersion": "2019-12-01", + "dependsOn": [ + "forgetmenot-apiservice" + ] + } + ] + } + } + } + ], + "metadata": { + "_dependencyType": "apis.azure" + } +} \ No newline at end of file diff --git a/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/storage1.arm.json b/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/storage1.arm.json new file mode 100644 index 0000000..4a14507 --- /dev/null +++ b/forgetmenot-api/Properties/ServiceDependencies/forgetmenot-api20220213151332 - Zip Deploy/storage1.arm.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "rg-forgetmenot", + "metadata": { + "_parameterType": "resourceGroup", + "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." + } + }, + "resourceGroupLocation": { + "type": "string", + "defaultValue": "centralus", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource group. Resource groups could have different location than resources." + } + }, + "resourceLocation": { + "type": "string", + "defaultValue": "[parameters('resourceGroupLocation')]", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." + } + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "name": "[parameters('resourceGroupName')]", + "location": "[parameters('resourceGroupLocation')]", + "apiVersion": "2019-10-01" + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('forgetmenotstorage', subscription().subscriptionId)))]", + "resourceGroup": "[parameters('resourceGroupName')]", + "apiVersion": "2019-10-01", + "dependsOn": [ + "[parameters('resourceGroupName')]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "kind": "Storage", + "name": "forgetmenotstorage", + "type": "Microsoft.Storage/storageAccounts", + "location": "[parameters('resourceLocation')]", + "apiVersion": "2017-10-01" + } + ] + } + } + } + ], + "metadata": { + "_dependencyType": "storage.azure" + } +} \ No newline at end of file diff --git a/forgetmenot-api/Properties/serviceDependencies.forgetmenot-api20220213151332 - Zip Deploy.json b/forgetmenot-api/Properties/serviceDependencies.forgetmenot-api20220213151332 - Zip Deploy.json new file mode 100644 index 0000000..fb41bf4 --- /dev/null +++ b/forgetmenot-api/Properties/serviceDependencies.forgetmenot-api20220213151332 - Zip Deploy.json @@ -0,0 +1,13 @@ +{ + "dependencies": { + "storage1": { + "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Storage/storageAccounts/forgetmenotstorage", + "type": "storage.azure", + "connectionId": "AzureWebJobsStorage" + }, + "apis1": { + "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.ApiManagement/service/forgetmenot-apiservice/apis/forgetmenot-api", + "type": "apis.azure" + } + } +} \ No newline at end of file diff --git a/forgetmenot-api/Properties/serviceDependencies.json b/forgetmenot-api/Properties/serviceDependencies.json index df4dcc9..163a59d 100644 --- a/forgetmenot-api/Properties/serviceDependencies.json +++ b/forgetmenot-api/Properties/serviceDependencies.json @@ -1,11 +1,11 @@ { "dependencies": { - "appInsights1": { - "type": "appInsights" - }, "storage1": { "type": "storage", "connectionId": "AzureWebJobsStorage" + }, + "apis1": { + "type": "apis" } } } \ No newline at end of file diff --git a/forgetmenot-api/Properties/serviceDependencies.local.json b/forgetmenot-api/Properties/serviceDependencies.local.json index c4e6990..7fcfb6b 100644 --- a/forgetmenot-api/Properties/serviceDependencies.local.json +++ b/forgetmenot-api/Properties/serviceDependencies.local.json @@ -1,8 +1,5 @@ { "dependencies": { - "appInsights1": { - "type": "appInsights.sdk" - }, "storage1": { "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourcegroups/[parameters('resourceGroupName')]/providers/Microsoft.Storage/storageAccounts/forgetmenotstorage", "type": "storage.azure", diff --git a/forgetmenot-api/host.json b/forgetmenot-api/host.json index beb2e40..889c2f1 100644 --- a/forgetmenot-api/host.json +++ b/forgetmenot-api/host.json @@ -1,11 +1,5 @@ { "version": "2.0", "logging": { - "applicationInsights": { - "samplingSettings": { - "isEnabled": true, - "excludedTypes": "Request" - } - } } } \ No newline at end of file