Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-kastil committed Feb 9, 2023
1 parent 9d97327 commit 2795511
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ public class Settings
{
public string Title { get; set; }
public bool AuthEnabled { get; set; }
public bool UseSQLite { get; set; }
public bool UseAppConfig { get; set; }
public string ConnectionString { get; set; }
public string KeyVault { get; set; }
public string AppConfig { get; set; }
public string AppConfigEndpoint { get; set; }
public string Sentinel { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
string connectionString = "Endpoint=https://foodconfig-dev.azconfig.io;Id=B1kS-l9-s0:O8WiC3kXo8OKaABKcK4y;Secret=dlCIR0ybMLVX1czEyI9AlaKOcVaINQbZZkkek8uKS88=";

builder.Configuration.AddAzureAppConfiguration(options =>
{
{
options.Connect(connectionString)
.ConfigureKeyVault(kv =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"AppSettings": {
"Title": "App Config From File",
"AuthEnabled": false,
"UseSQLite": true,
"UseAppConfig": false,
"ConnectionString": "Data Source=./food-local.db",
"KeyVault": "foodvault-dev.vault.azure.net",
"AppConfig": "https://foodconfig-dev.azconfig.io",
"AppConfigEndpoint": "https://foodconfig-dev.azconfig.io",
"Sentinel": 1
},
"FeatureManagement": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ app=config-api-$env
plan=config-plan-$env

# create appconfig and add a value
az appconfig create -g $grp -n $cfg -l $loc --sku free
appconfigid=$(az appconfig create -g $grp -n $cfg -l $loc --sku free --query id -o tsv)
az appconfig kv set -n $cfg --key "Settings:Title" --value "App Config Demo Dev" -y
az appconfig kv set -n $cfg --key "Settings:Title" --value "App Config Demo" -y --label production

Expand Down Expand Up @@ -36,6 +36,9 @@ cd config-service-api
az webapp up -n $app -g $grp -p $plan -l $loc --sku Free --runtime "DOTNET|6.0"
cd ..
webmi=$(az webapp identity assign -g $grp -n $app --query principalId -o tsv)

az keyvault set-policy -n $vault --object-id $webmi --secret-permissions get list

# add app config reader permissions to managed identity
az role assignment create --role "App Configuration Data Reader" --assignee $webmi --scope $appconfigid

az webapp restart -g $grp -n $app

0 comments on commit 2795511

Please sign in to comment.