Skip to content

Instantly share code, notes, and snippets.

@michmzr
Created June 28, 2022 07:47
Show Gist options
  • Save michmzr/2beda67bc534d9bef0c63b4dfe287736 to your computer and use it in GitHub Desktop.
Save michmzr/2beda67bc534d9bef0c63b4dfe287736 to your computer and use it in GitHub Desktop.
Azure app service
# Generates a JSON with valid format of Azure App Service enviroment variables - https://docs.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal
# Script uses json with env variables in format {"ENV_NAME": "ENV_VALUE",...}
import json
# Opening JSON file
f = open("env.json")
# returns JSON object as
# a dictionary
data = json.load(f)
azureAppServiceEnv = []
for key in data:
azureAppServiceEnv.append({
"name": key,
"value": data[key],
"slotSetting": "false"
})
# Closing file
print(json.dumps(azureAppServiceEnv))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment