File tree Expand file tree Collapse file tree 5 files changed +20
-7
lines changed
Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 2424POSSIBILITY OF SUCH DAMAGE.
2525"""
2626from azureml .core import Workspace
27- import os , json
27+ import os , json , sys
2828import azureml .core
29+ from azureml .core .authentication import AzureCliAuthentication
2930
3031print ("SDK Version:" , azureml .core .VERSION )
3132# print('current dir is ' +os.curdir)
3637resource_group = config ["resource_group" ]
3738subscription_id = config ["subscription_id" ]
3839location = config ["location" ]
39- # location = 'southcentralus'
40+
41+ cli_auth = AzureCliAuthentication ()
42+
4043try :
4144 ws = Workspace .get (
4245 name = workspace_name ,
4346 subscription_id = subscription_id ,
4447 resource_group = resource_group ,
48+ auth = cli_auth
4549 )
4650
4751except :
5357 resource_group = resource_group ,
5458 # create_resource_group=True,
5559 location = location ,
60+ auth = cli_auth
61+
5662 )
5763
5864# print Workspace details
Original file line number Diff line number Diff line change 2929from azureml .core import Experiment
3030from azureml .core import ScriptRunConfig
3131import json
32+ from azureml .core .authentication import AzureCliAuthentication
33+ cli_auth = AzureCliAuthentication ()
3234
3335# Get workspace
34- ws = Workspace .from_config ()
36+ ws = Workspace .from_config (auth = cli_auth )
3537
3638# Attach Experiment
3739experiment_name = "devops-ai-demo"
Original file line number Diff line number Diff line change 2929from azureml .core .model import Model
3030import azureml .core
3131from azureml .core import Run
32-
32+ from azureml .core .authentication import AzureCliAuthentication
33+ cli_auth = AzureCliAuthentication ()
3334
3435# Get workspace
35- ws = Workspace .from_config ()
36+ ws = Workspace .from_config (auth = cli_auth )
3637
3738# Paramaterize the matrics on which the models should be compared
3839
Original file line number Diff line number Diff line change 3030from azureml .core .model import Model
3131
3232from azureml .core .runconfig import RunConfiguration
33+ from azureml .core .authentication import AzureCliAuthentication
34+ cli_auth = AzureCliAuthentication ()
3335
3436# Get workspace
35- ws = Workspace .from_config ()
37+ ws = Workspace .from_config (auth = cli_auth )
3638
3739# Get the latest evaluation result
3840try :
Original file line number Diff line number Diff line change 2727from azureml .core import Workspace
2828from azureml .core .image import ContainerImage , Image
2929from azureml .core .model import Model
30+ from azureml .core .authentication import AzureCliAuthentication
31+ cli_auth = AzureCliAuthentication ()
3032
3133# Get workspace
32- ws = Workspace .from_config ()
34+ ws = Workspace .from_config (auth = cli_auth )
3335
3436# Get the latest model details
3537
You can’t perform that action at this time.
0 commit comments