You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 11, 2026. It is now read-only.
I found that there're some options about the setting of Workspace in Azure ML in /src/utils.py script, and they're ordered sequentially. Indeed, they consist of 3 steps with try - except structure:
Induce from run object
try:
run=Run.get_context()
ifnotisinstance(run, _OfflineRun):
ws=run.experiment.workspacereturnwsexceptExceptionasex:
print('Workspace from run not found', ex)
Retrieve config file with .from_config() method
try:
ws=Workspace.from_config()
returnwsexceptExceptionasex:
print('Workspace config not found in local folder', ex)
Pre-defined subscription & Service principal
try:
sp=ServicePrincipalAuthentication(
tenant_id=os.environ['AML_TENANT_ID'],
service_principal_id=os.environ['AML_PRINCIPAL_ID'],
service_principal_password=os.environ['AML_PRINCIPAL_PASS']
)
ws=Workspace.get(
name="<ml-example>",
auth=sp,
subscription_id="<your-sub-id>"
)
exceptExceptionasex:
print('Workspace config not found in project', ex)
Imagine that an user wants to use option 3(Service principal), and he/she receives errors for both options 1/2. Then, is it better to modify the structure of try - except?
I found that there're some options about the setting of
Workspacein Azure ML in/src/utils.pyscript, and they're ordered sequentially. Indeed, they consist of 3 steps withtry - exceptstructure:runobject.from_config()methodImagine that an user wants to use option 3(Service principal), and he/she receives errors for both options 1/2. Then, is it better to modify the structure of
try - except?