File tree Expand file tree Collapse file tree 8 files changed +26
-16
lines changed
Expand file tree Collapse file tree 8 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 2626import os
2727from azureml .core import Experiment
2828from azureml .core import Workspace
29-
29+ from azureml .core .authentication import AzureCliAuthentication
30+ cli_auth = AzureCliAuthentication ()
3031
3132def getExperiment ():
32- ws = Workspace .from_config ()
33+ ws = Workspace .from_config (auth = cli_auth )
3334 script_folder = "."
3435 experiment_name = "devops-ai-demo"
3536 exp = Experiment (workspace = ws , name = experiment_name )
Original file line number Diff line number Diff line change 3333from azureml .core .compute import RemoteCompute
3434from azureml .core .compute import DsvmCompute
3535from azureml .core .compute_target import ComputeTargetException
36-
36+ from azureml .core .authentication import AzureCliAuthentication
37+ cli_auth = AzureCliAuthentication ()
3738
3839# Get workspace
39- ws = Workspace .from_config ()
40+ ws = Workspace .from_config (auth = cli_auth )
4041
4142# Read the New VM Config
4243with open ("aml_config/security_config.json" ) as f :
Original file line number Diff line number Diff line change 3232from azureml .core import Experiment
3333from azureml .core import ScriptRunConfig
3434
35+ from azureml .core .authentication import AzureCliAuthentication
36+ cli_auth = AzureCliAuthentication ()
37+
3538# Get workspace
36- ws = Workspace .from_config ()
39+ ws = Workspace .from_config (auth = cli_auth )
3740
3841# Attach Experiment
3942experiment_name = "devops-ai-demo"
Original file line number Diff line number Diff line change 3030from azureml .core .runconfig import RunConfiguration
3131from azureml .core import ScriptRunConfig
3232import azureml .core
33+ from azureml .core .authentication import AzureCliAuthentication
3334
34-
35+ cli_auth = AzureCliAuthentication ()
3536# Get workspace
36- ws = Workspace .from_config ()
37+ ws = Workspace .from_config (auth = cli_auth )
38+
3739
3840# Read the New VM Config
3941with open ("aml_config/security_config.json" ) as f :
Original file line number Diff line number Diff line change 3030from azureml .core .image import Image
3131from azureml .core .webservice import Webservice
3232from azureml .core .webservice import AciWebservice
33+ from azureml .core .authentication import AzureCliAuthentication
3334
35+ cli_auth = AzureCliAuthentication ()
3436# Get workspace
35- ws = Workspace .from_config ()
36-
37-
38- # Get the Image to deploy details
37+ ws = Workspace .from_config (auth = cli_auth )# Get the Image to deploy details
3938try :
4039 with open ("aml_config/image.json" ) as f :
4140 config = json .load (f )
Original file line number Diff line number Diff line change 3030from azureml .core .image import Image
3131from azureml .core .compute import AksCompute , ComputeTarget
3232from azureml .core .webservice import Webservice , AksWebservice
33+ from azureml .core .authentication import AzureCliAuthentication
3334
35+ cli_auth = AzureCliAuthentication ()
3436# Get workspace
35- ws = Workspace .from_config ()
37+ ws = Workspace .from_config (auth = cli_auth )
3638
3739# Get the Image to deploy details
3840try :
Original file line number Diff line number Diff line change 3131from azureml .core .image import Image
3232from azureml .core .webservice import Webservice
3333from azureml .core .webservice import AciWebservice
34+ from azureml .core .authentication import AzureCliAuthentication
3435
36+ cli_auth = AzureCliAuthentication ()
3537# Get workspace
36- ws = Workspace .from_config ()
37-
38+ ws = Workspace .from_config (auth = cli_auth )
3839# Get the ACI Details
3940try :
4041 with open ("aml_config/aci_webservice.json" ) as f :
Original file line number Diff line number Diff line change 3030from azureml .core .model import Model
3131from azureml .core .image import Image
3232from azureml .core .webservice import Webservice
33+ from azureml .core .authentication import AzureCliAuthentication
3334
34-
35+ cli_auth = AzureCliAuthentication ()
3536# Get workspace
36- ws = Workspace .from_config ()
37+ ws = Workspace .from_config (auth = cli_auth )
3738
3839# Get the AKS Details
3940try :
You can’t perform that action at this time.
0 commit comments