forked from Azure/azureml-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello-world.sh
63 lines (51 loc) · 1.42 KB
/
hello-world.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## IMPORTANT: this file and accompanying assets are the source for snippets in https://docs.microsoft.com/azure/machine-learning!
## Please reach out to the Azure ML docs & samples team before before editing for the first time.
# <hello_world>
az ml job create -f jobs/hello-world.yml --web --stream
# </hello_world>
# <check_job_status>
az ml job show -n $run_id --query status -o tsv
# </check_job_status>
# <hello_world_output>
run_id=$(az ml job create -f jobs/hello-world.yml --query name -o tsv)
# </hello_world_output>
# <show_job_in_studio>
az ml job show -n $run_id --web
# </show_job_in_studio>
# <stream_job_logs_to_console>
az ml job stream -n $run_id
# </stream_job_logs_to_console>
# <check_job_status_detailed>
status=$(az ml job show -n $run_id --query status -o tsv)
echo $status
if [[ $status == "Completed" ]]
then
echo "Job completed"
elif [[ $status == "Failed" ]]
then
echo "Job failed"
exit 1
else
echo "Job status not failed or completed"
exit 2
fi
# </check_job_status>
# <az_extension_list>
az extension list
# </az_extension_list>
# <az_ml_install>
az extension add -n ml
# </az_ml_install>
# <az_ml_update>
az extension update -n ml
# </az_ml_update>
# <az_ml_verify>
az ml -h
# </az_ml_verify>
# <az_account_set>
az account set -s "<YOUR_SUBSCRIPTION_NAME_OR_ID>"
# </az_account_set>
# <az_extension_remove>
az extension remove -n azure-cli-ml
az extension remove -n ml
# </az_extension_remove>