Created
August 17, 2018 23:11
-
-
Save ramnov/82772b762cc6c54e71fad041de02a3b1 to your computer and use it in GitHub Desktop.
Python script to modify jwtsigningcertificate in Microsoft Machine Learning Server Webnode appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import json | |
from collections import OrderedDict | |
appSettingsFilePath = "/opt/microsoft/mlserver/9.3.0/o16n/Microsoft.MLServer.WebNode/appsettings.json" | |
data = json.loads(open(appSettingsFilePath, "r").read().replace("\r\n",""), object_pairs_hook=OrderedDict) | |
data["Authentication"]["JWTSigningCertificate"]["Enabled"] = True | |
data["Authentication"]["JWTSigningCertificate"]["StoreName"] = "Root" | |
data["Authentication"]["JWTSigningCertificate"]["StoreLocation"] = "CurrentUser" | |
data["Authentication"]["JWTSigningCertificate"]["SubjectName"] = "CN=LOCALHOST" | |
with open(appSettingsFilePath, "w") as f: | |
json.dump(data, f, indent=4, sort_keys=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment