Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

.net core - Migrate from appsettings.json to ARM

Scenario I host my Net Core 3.1 WebApp Aplication on a Linux App Service Plan on Azure. I use some library which needs to have provided some settings object in appsettings.json like this:

"Container": {
  "Settings1": "val1",
  "Settings2": "val2"
}

How to provide those appsettings in ARM template? I have tried:

"appSettings": [
  {
    "name": "Container:Settings1",
    "value": "val1"
  },
  {
    "name": "Container:Settings2",
    "value": "val2"
  },

but : does not help me set those settings in way that is needed for those third party library


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For reason that I use Linux Web App, it is needed to set appSettings with double underscore __ instead of colon :

"appSettings": [
  {
    "name": "Container__Settings1",
    "value": "val1"
  },
  {
    "name": "Container__Settings2",
    "value": "val2"
  },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...