Skip to content

Commit

Permalink
Added secret connection
Browse files Browse the repository at this point in the history
  • Loading branch information
goodtocode committed Jul 4, 2023
1 parent da53787 commit 6500043
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:42007",
"sslPort": 44323
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5124",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7171;http://localhost:5124",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
25 changes: 25 additions & 0 deletions src/Subjects/Presentation.Api.WebApi/appsettings.Local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"ClientId": "7cf20ddf-bc1b-423e-b516-43d386b31da5",
"Domain": "GoodToCode.com",
"TenantId": "ad6529dd-8db1-4015-a53d-6ae395fc7e39"
},
"Azure": {
"UseKeyVault": true,
"KeyVaultUri": "https://kv-subjects-dev-001.vault.azure.net/"
},
"UseInMemoryDatabase": false
//"ConnectionStrings": {
// "SubjectsConnection": "FROM_APP_SERVICE"
//},
//"ApplicationInsights": {
// "ConnectionString": "FROM_APP_SERVICE"
//}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"ClientId": "7cf20ddf-bc1b-423e-b516-43d386b31da5",
"ClientId": "CLIENT_ID",
"Domain": "GoodToCode.com",
"TenantId": "ad6529dd-8db1-4015-a53d-6ae395fc7e39"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Goodtocode.Subjects.BlazorServer-162fe164-2aae-4a7b-adcf-a4ef2cd6803d</UserSecretsId>
<WebProject_DirectoryAccessLevelKey>0</WebProject_DirectoryAccessLevelKey>
<ApplicationInsightsResourceId>/subscriptions/2d60a88f-6c6a-48e6-844b-69bb857dd4fe/resourceGroups/gtc-rg-subjects-dev-001/providers/microsoft.insights/components/appi-subjects-dev-001</ApplicationInsightsResourceId>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceGroupName": {
"type": "string",
"defaultValue": "gtc-rg-subjects-dev-001",
"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": "westus3",
"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('appi-subjects-dev-001', 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": "appi-subjects-dev-001",
"type": "microsoft.insights/components",
"location": "[parameters('resourceLocation')]",
"kind": "web",
"properties": {},
"apiVersion": "2015-05-01"
}
]
}
}
}
],
"metadata": {
"_dependencyType": "appInsights.azure"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:15622",
"sslPort": 44375
}
},
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7169;http://localhost:5127",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"identityapp1": {
"type": "identityapp",
"dynamicId": null
},
"appInsights1": {
"type": "appInsights",
"connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"dynamicId": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
"identityapp1": {
"type": "identityapp.default",
"dynamicId": null
},
"appInsights1": {
"secretStore": "LocalSecretsFile",
"resourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/microsoft.insights/components/appi-subjects-dev-001",
"type": "appInsights.azure",
"connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"dynamicId": null
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"AzureAd": {
"Instance": "https://GoodToCodeB2C.b2clogin.com/",
"Domain": "GoodToCodeB2C.onmicrosoft.com",
"TenantId": "TENANT_ID",
"ClientId": "CLIENT_ID",
"CallbackPath": "/signin-oidc",
"SignUpSignInPolicyId": "B2C_1_Signup_Signin",
"SignedOutCallbackPath": "/signout/B2C_1_susi",
"ResetPasswordPolicyId": "b2c_1_reset",
"EditProfilePolicyId": "b2c_1_edit_profile",
"EnablePiiLogging": true
},
"Azure": {
"UseKeyVault": true,
"KeyVaultUri": "https://kv-subjects-prod-001.vault.azure.net/"
},
"Subjects": {
"ClientId": "CLIENT_ID",
"TokenUrl": "https://login.microsoftonline.com/ad6529dd-8db1-4015-a53d-6ae395fc7e39/oauth2/v2.0/token",
"Scope": "api://API_CLIENT_ID/.default",
"Url": "https://api-subjects-prod-001.azurewebsites.net"
}
//"Subjects:ClientSecret": "FROM_KEY_VAULT"
//"ApplicationInsights": {
// "ConnectionString": "FROM_APP_SERVICE"
//}
}

0 comments on commit 6500043

Please sign in to comment.