Skip to content

Commit b4c32dd

Browse files
committed
WireMock.Net.WebApplication.NET6
1 parent 57115f1 commit b4c32dd

File tree

3 files changed

+197
-36
lines changed

3 files changed

+197
-36
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"metadata": {
5+
"_dependencyType": "compute.function.linux.appService"
6+
},
7+
"parameters": {
8+
"resourceGroupName": {
9+
"type": "string",
10+
"defaultValue": "linux-app-service",
11+
"metadata": {
12+
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
13+
}
14+
},
15+
"resourceGroupLocation": {
16+
"type": "string",
17+
"defaultValue": "westeurope",
18+
"metadata": {
19+
"description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
20+
}
21+
},
22+
"resourceName": {
23+
"type": "string",
24+
"defaultValue": "WireMockNetWebApplicationNET6Linux",
25+
"metadata": {
26+
"description": "Name of the main resource to be created by this template."
27+
}
28+
},
29+
"resourceLocation": {
30+
"type": "string",
31+
"defaultValue": "[parameters('resourceGroupLocation')]",
32+
"metadata": {
33+
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
34+
}
35+
}
36+
},
37+
"resources": [
38+
{
39+
"type": "Microsoft.Resources/resourceGroups",
40+
"name": "[parameters('resourceGroupName')]",
41+
"location": "[parameters('resourceGroupLocation')]",
42+
"apiVersion": "2019-10-01"
43+
},
44+
{
45+
"type": "Microsoft.Resources/deployments",
46+
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
47+
"resourceGroup": "[parameters('resourceGroupName')]",
48+
"apiVersion": "2019-10-01",
49+
"dependsOn": [
50+
"[parameters('resourceGroupName')]"
51+
],
52+
"properties": {
53+
"mode": "Incremental",
54+
"expressionEvaluationOptions": {
55+
"scope": "inner"
56+
},
57+
"parameters": {
58+
"resourceGroupName": {
59+
"value": "[parameters('resourceGroupName')]"
60+
},
61+
"resourceGroupLocation": {
62+
"value": "[parameters('resourceGroupLocation')]"
63+
},
64+
"resourceName": {
65+
"value": "[parameters('resourceName')]"
66+
},
67+
"resourceLocation": {
68+
"value": "[parameters('resourceLocation')]"
69+
}
70+
},
71+
"template": {
72+
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
73+
"contentVersion": "1.0.0.0",
74+
"parameters": {
75+
"resourceGroupName": {
76+
"type": "string"
77+
},
78+
"resourceGroupLocation": {
79+
"type": "string"
80+
},
81+
"resourceName": {
82+
"type": "string"
83+
},
84+
"resourceLocation": {
85+
"type": "string"
86+
}
87+
},
88+
"variables": {
89+
"storage_name": "[toLower(concat('storage', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId))))]",
90+
"appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
91+
"storage_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('storage_name'))]",
92+
"appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]",
93+
"function_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/sites/', parameters('resourceName'))]"
94+
},
95+
"resources": [
96+
{
97+
"location": "[parameters('resourceLocation')]",
98+
"name": "[parameters('resourceName')]",
99+
"type": "Microsoft.Web/sites",
100+
"apiVersion": "2015-08-01",
101+
"tags": {
102+
"[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
103+
},
104+
"dependsOn": [
105+
"[variables('appServicePlan_ResourceId')]",
106+
"[variables('storage_ResourceId')]"
107+
],
108+
"kind": "functionapp",
109+
"properties": {
110+
"name": "[parameters('resourceName')]",
111+
"kind": "functionapp",
112+
"httpsOnly": true,
113+
"reserved": false,
114+
"serverFarmId": "[variables('appServicePlan_ResourceId')]",
115+
"siteConfig": {
116+
"alwaysOn": true,
117+
"linuxFxVersion": "dotnet|3.1"
118+
}
119+
},
120+
"identity": {
121+
"type": "SystemAssigned"
122+
},
123+
"resources": [
124+
{
125+
"name": "appsettings",
126+
"type": "config",
127+
"apiVersion": "2015-08-01",
128+
"dependsOn": [
129+
"[variables('function_ResourceId')]"
130+
],
131+
"properties": {
132+
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
133+
"FUNCTIONS_EXTENSION_VERSION": "~3",
134+
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
135+
}
136+
}
137+
]
138+
},
139+
{
140+
"location": "[parameters('resourceGroupLocation')]",
141+
"name": "[variables('storage_name')]",
142+
"type": "Microsoft.Storage/storageAccounts",
143+
"apiVersion": "2017-10-01",
144+
"tags": {
145+
"[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]": "empty"
146+
},
147+
"properties": {
148+
"supportsHttpsTrafficOnly": true
149+
},
150+
"sku": {
151+
"name": "Standard_LRS"
152+
},
153+
"kind": "Storage"
154+
},
155+
{
156+
"location": "[parameters('resourceGroupLocation')]",
157+
"name": "[variables('appServicePlan_name')]",
158+
"type": "Microsoft.Web/serverFarms",
159+
"apiVersion": "2015-02-01",
160+
"kind": "linux",
161+
"properties": {
162+
"name": "[variables('appServicePlan_name')]",
163+
"sku": "Standard",
164+
"workerSizeId": "0",
165+
"reserved": true
166+
}
167+
}
168+
]
169+
}
170+
}
171+
}
172+
]
173+
}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6</TargetFramework>
5-
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
6-
<StartupObject>WireMock.Net.WebApplication.Program</StartupObject>
7-
<AssemblyName>WireMock.Net.WebApplication</AssemblyName>
8-
<RootNamespace>WireMock.Net.WebApplication</RootNamespace>
9-
<UserSecretsId>efcf4a18-fd7c-4622-1111-336d65290599</UserSecretsId>
10-
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
11-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net6</TargetFramework>
5+
<!--<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>-->
6+
<StartupObject>WireMock.Net.WebApplication.Program</StartupObject>
7+
<AssemblyName>WireMock.Net.WebApplication</AssemblyName>
8+
<RootNamespace>WireMock.Net.WebApplication</RootNamespace>
9+
<UserSecretsId>efcf4a18-fd7c-4622-1111-336d65290599</UserSecretsId>
10+
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
11+
</PropertyGroup>
1212

13-
<ItemGroup>
14-
<Content Remove="Properties\1.launchSettings.json" />
15-
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
15+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
16+
</ItemGroup>
1617

17-
<ItemGroup>
18-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
19-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
20-
</ItemGroup>
18+
<ItemGroup>
19+
<ProjectReference Include="..\..\src\WireMock.Net.Abstractions\WireMock.Net.Abstractions.csproj" />
20+
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
21+
</ItemGroup>
2122

22-
<ItemGroup>
23-
<ProjectReference Include="..\..\src\WireMock.Net.Abstractions\WireMock.Net.Abstractions.csproj" />
24-
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
25-
</ItemGroup>
26-
27-
<ItemGroup>
28-
<Content Update="appsettings.json">
29-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30-
</Content>
31-
</ItemGroup>
23+
<ItemGroup>
24+
<Content Update="appsettings.json">
25+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26+
</Content>
27+
</ItemGroup>
3228

3329
</Project>

examples/WireMock.Net.WebApplication.NET6/appsettings.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,7 @@
1515
"WireMockServerSettings": {
1616
"StartAdminInterface": true,
1717
"Urls": [
18-
"https://localhost:8081/"
19-
],
20-
"AllowPartialMapping": false,
21-
"HandleRequestsSynchronously": true,
22-
"ThrowExceptionWhenMatcherFails": true,
23-
"ProxyAndRecordSettings": {
24-
"Url": "http://postman-echo.com/post",
25-
"SaveMapping": true,
26-
"SaveMappingToFile": true
27-
}
18+
"http://localhost"
19+
]
2820
}
2921
}

0 commit comments

Comments
 (0)