Skip to content

Commit 33b7e46

Browse files
committed
Update Program.cs, add ARM templates, and upgrade package
- Updated `Program.cs` to use `ConfigureFunctionsWebApplication` instead of `ConfigureFunctionsWorkerDefaults`. - Added ARM templates: `appInsights1.arm.json` for Application Insights and `storage1.arm.json` for Storage Account. - Updated `serviceDependencies.azureprojectgenerator.json` to include resource IDs and connection strings for the new resources. - Updated `serviceDependencies.json` to include connection IDs for the new resources. - Upgraded `Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore` in `azure-project-generator.csproj` from version `1.2.1` to `1.3.2`. - Removed an unnecessary empty line in the constructor of `ContentGenerationService.cs`.
1 parent 4605910 commit 33b7e46

File tree

7 files changed

+161
-10
lines changed

7 files changed

+161
-10
lines changed

azure-project-generator/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Microsoft.Extensions.Hosting;
88

99
var host = new HostBuilder()
10-
.ConfigureFunctionsWorkerDefaults()
10+
.ConfigureFunctionsWebApplication()
1111
.ConfigureServices((context, services) =>
1212
{
1313
services.AddApplicationInsightsTelemetryWorkerService();
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resourceGroupName": {
6+
"type": "string",
7+
"defaultValue": "azureprojectgenerator-rg",
8+
"metadata": {
9+
"_parameterType": "resourceGroup",
10+
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
11+
}
12+
},
13+
"resourceGroupLocation": {
14+
"type": "string",
15+
"defaultValue": "eastus",
16+
"metadata": {
17+
"_parameterType": "location",
18+
"description": "Location of the resource group. Resource groups could have different location than resources."
19+
}
20+
},
21+
"resourceLocation": {
22+
"type": "string",
23+
"defaultValue": "[parameters('resourceGroupLocation')]",
24+
"metadata": {
25+
"_parameterType": "location",
26+
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
27+
}
28+
}
29+
},
30+
"resources": [
31+
{
32+
"type": "Microsoft.Resources/resourceGroups",
33+
"name": "[parameters('resourceGroupName')]",
34+
"location": "[parameters('resourceGroupLocation')]",
35+
"apiVersion": "2019-10-01"
36+
},
37+
{
38+
"type": "Microsoft.Resources/deployments",
39+
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('azure-project-generator', subscription().subscriptionId)))]",
40+
"resourceGroup": "[parameters('resourceGroupName')]",
41+
"apiVersion": "2019-10-01",
42+
"dependsOn": [
43+
"[parameters('resourceGroupName')]"
44+
],
45+
"properties": {
46+
"mode": "Incremental",
47+
"template": {
48+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
49+
"contentVersion": "1.0.0.0",
50+
"resources": [
51+
{
52+
"kind": "web",
53+
"name": "azure-project-generator",
54+
"type": "microsoft.insights/components",
55+
"location": "[parameters('resourceLocation')]",
56+
"properties": {},
57+
"apiVersion": "2015-05-01"
58+
}
59+
]
60+
}
61+
}
62+
}
63+
],
64+
"metadata": {
65+
"_dependencyType": "appInsights.azure"
66+
}
67+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resourceGroupName": {
6+
"type": "string",
7+
"defaultValue": "azureprojectgenerator-rg",
8+
"metadata": {
9+
"_parameterType": "resourceGroup",
10+
"description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
11+
}
12+
},
13+
"resourceGroupLocation": {
14+
"type": "string",
15+
"defaultValue": "eastus",
16+
"metadata": {
17+
"_parameterType": "location",
18+
"description": "Location of the resource group. Resource groups could have different location than resources."
19+
}
20+
},
21+
"resourceLocation": {
22+
"type": "string",
23+
"defaultValue": "[parameters('resourceGroupLocation')]",
24+
"metadata": {
25+
"_parameterType": "location",
26+
"description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
27+
}
28+
}
29+
},
30+
"resources": [
31+
{
32+
"type": "Microsoft.Resources/resourceGroups",
33+
"name": "[parameters('resourceGroupName')]",
34+
"location": "[parameters('resourceGroupLocation')]",
35+
"apiVersion": "2019-10-01"
36+
},
37+
{
38+
"type": "Microsoft.Resources/deployments",
39+
"name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('azureprojectgenstor', subscription().subscriptionId)))]",
40+
"resourceGroup": "[parameters('resourceGroupName')]",
41+
"apiVersion": "2019-10-01",
42+
"dependsOn": [
43+
"[parameters('resourceGroupName')]"
44+
],
45+
"properties": {
46+
"mode": "Incremental",
47+
"template": {
48+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
49+
"contentVersion": "1.0.0.0",
50+
"resources": [
51+
{
52+
"sku": {
53+
"name": "Standard_RAGRS",
54+
"tier": "Standard"
55+
},
56+
"kind": "StorageV2",
57+
"name": "azureprojectgenstor",
58+
"type": "Microsoft.Storage/storageAccounts",
59+
"location": "[parameters('resourceLocation')]",
60+
"apiVersion": "2017-10-01"
61+
}
62+
]
63+
}
64+
}
65+
}
66+
],
67+
"metadata": {
68+
"_dependencyType": "storage.azure"
69+
}
70+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"dependencies": {
3+
"appInsights1": {
4+
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/microsoft.insights/components/azure-project-generator",
5+
"type": "appInsights.azure",
6+
"connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING"
7+
},
8+
"storage1": {
9+
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Storage/storageAccounts/azureprojectgenstor",
10+
"type": "storage.azure",
11+
"connectionId": "AzureWebJobsStorage"
12+
}
13+
}
14+
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"dependencies": {
3-
"appInsights1": {
4-
"type": "appInsights"
5-
},
6-
"storage1": {
7-
"type": "storage",
8-
"connectionId": "AzureWebJobsStorage"
9-
},
103
"secrets1": {
114
"type": "secrets"
125
},
136
"storage2": {
147
"type": "storage",
158
"connectionId": "azurestorage",
169
"dynamicId": null
10+
},
11+
"appInsights1": {
12+
"type": "appInsights",
13+
"connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING"
14+
},
15+
"storage1": {
16+
"type": "storage",
17+
"connectionId": "AzureWebJobsStorage"
1718
}
1819
}
1920
}

azure-project-generator/azure-project-generator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
2222
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.10.0" />
2323
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
24-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.1" />
24+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
2525
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.0" />
2626
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
2727
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />

azure-project-generator/services/ContentGenerationService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public ContentGenerationService(ILogger<ContentGenerationService> logger, Embedd
1717
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
1818
_embeddingClient = embeddingClient ?? throw new ArgumentNullException(nameof(embeddingClient));
1919
_completionsClient = completionsClient ?? throw new ArgumentNullException(nameof(completionsClient));
20-
2120
}
2221

2322
public string GenerateCertServiceContextSentence(CertificationService data) =>

0 commit comments

Comments
 (0)