{"id":42074,"date":"2024-05-14T00:41:06","date_gmt":"2024-05-14T07:41:06","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=42074"},"modified":"2024-05-10T06:54:19","modified_gmt":"2024-05-10T13:54:19","slug":"azure-machine-learning-service-for-kubernetes-architects-deploy-your-first-model-on-aks-with-az-cli-v2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/azure-machine-learning-service-for-kubernetes-architects-deploy-your-first-model-on-aks-with-az-cli-v2\/","title":{"rendered":"Azure Machine Learning Service for Kubernetes Architects: Deploy Your First Model on AKS with AZ CLI v2"},"content":{"rendered":"<p><a href=\"https:\/\/www.linkedin.com\/in\/joseph-masengesho-a970b134\/\">Joseph Masengesho<\/a> provides a step-by-step tutorial on how to deploy your first ML model on AKS.<\/p>\n<hr \/>\n<p id=\"a062\" class=\"pw-post-body-paragraph mk ml gt mm b mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh gm bj\" data-selectable-paragraph=\"\">In a\u00a0<a class=\"af ni\" href=\"https:\/\/medium.com\/@jmasengesho\/azure-machine-learning-service-for-kubernetes-architects-part-i-ml-extension-and-inference-router-2a763fb9960d\" rel=\"noopener\">previous post<\/a>, I provided a lengthy write-up about my understanding of using Kubernetes as a compute target in Azure ML from a Kubernetes architect\u2019s perspective. In this post, I will offer a step-by-step tutorial that teaches you how to deploy your first ML model on AKS. As a disclaimer, I am not a data scientist; however, I work with customers who deploy ML workloads on Kubernetes.<\/p>\n<p id=\"b8dc\" class=\"pw-post-body-paragraph mk ml gt mm b mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh gm bj\" data-selectable-paragraph=\"\">In this tutorial, we will deploy a trained regression model based on the\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/open-datasets\/dataset-mnist?tabs=azureml-opendatasets\" target=\"_blank\" rel=\"noopener ugc nofollow\">MNIST Dataset<\/a>, which consists of 60K handwritten digits for training and 10K for testing. The model was created using the\u00a0<a class=\"af ni\" href=\"https:\/\/scikit-learn.org\/stable\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">scikit-learn framework<\/a>. You can learn more about how to use it in Azure ML\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/machine-learning\/how-to-train-scikit-learn?view=azureml-api-2\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>. We will use\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/machine-learning\/how-to-configure-cli?view=azureml-api-2&amp;tabs=public\" target=\"_blank\" rel=\"noopener ugc nofollow\">Azure CLI v2<\/a>\u00a0(<strong class=\"mm gu\">az ml<\/strong>), but you can also use Python SDK v2.<\/p>\n<p data-selectable-paragraph=\"\">\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2024\/05\/mnistdataset-1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-42076\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2024\/05\/mnistdataset-1.png\" alt=\"Image mnistdataset\" width=\"828\" height=\"468\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2024\/05\/mnistdataset-1.png 828w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2024\/05\/mnistdataset-1-300x170.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2024\/05\/mnistdataset-1-768x434.png 768w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/a><\/p>\n<h2 id=\"44c5\" class=\"ob oc gt be od oe of dx og oh oi dz oj mv ok ol om mz on oo op nd oq or os ot bj\" data-selectable-paragraph=\"\">Prerequisites<\/h2>\n<ul class=\"\">\n<li id=\"e51d\" class=\"mk ml gt mm b mn ou mp mq mr ov mt mu mv ow mx my mz ox nb nc nd oy nf ng nh oz pa pb bj\" data-selectable-paragraph=\"\"><strong class=\"mm gu\">A machine learning workspace.\u00a0<\/strong>You can learn how to create one\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/machine-learning\/quickstart-create-resources?view=azureml-api-2#create-the-workspace\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>.<\/li>\n<li id=\"a898\" class=\"mk ml gt mm b mn pc mp mq mr pd mt mu mv pe mx my mz pf nb nc nd pg nf ng nh oz pa pb bj\" data-selectable-paragraph=\"\"><strong class=\"mm gu\">A Kubernetes cluster.\u00a0<\/strong>You can learn how to create one\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/aks\/learn\/quick-kubernetes-deploy-portal?tabs=azure-cli\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>. At minimum, you need a system node pool. We will optionally create a dedicated node pool for this lab.<\/li>\n<li id=\"e53d\" class=\"mk ml gt mm b mn pc mp mq mr pd mt mu mv pe mx my mz pf nb nc nd pg nf ng nh oz pa pb bj\" data-selectable-paragraph=\"\"><strong class=\"mm gu\">az ml CLI (v2).<\/strong>\u00a0Learn how to upgrade or install it\u00a0<a class=\"af ni\" href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/machine-learning\/how-to-configure-cli?view=azureml-api-2&amp;tabs=public\" target=\"_blank\" rel=\"noopener ugc nofollow\">here<\/a>.<\/li>\n<li id=\"b6ee\" class=\"mk ml gt mm b mn pc mp mq mr pd mt mu mv pe mx my mz pf nb nc nd pg nf ng nh oz pa pb bj\" data-selectable-paragraph=\"\"><strong class=\"mm gu\">Github Repository<\/strong>: All the scripts used in this lab are available in this\u00a0<a class=\"af ni\" href=\"https:\/\/github.com\/jmasengeshomsft\/azure-ml-on-aks-cli-step-by-step\" target=\"_blank\" rel=\"noopener ugc nofollow\">repo<\/a>.<\/li>\n<\/ul>\n<h2 id=\"75a5\" class=\"ob oc gt be od oe of dx og oh oi dz oj mv ok ol om mz on oo op nd oq or os ot bj\" data-selectable-paragraph=\"\">Cloning the repository<\/h2>\n<p id=\"af84\" class=\"pw-post-body-paragraph mk ml gt mm b mn ou mp mq mr ov mt mu mv ow mx my mz ox nb nc nd oy nf ng nh gm bj\" data-selectable-paragraph=\"\">The files used in this tutorial are available on my Github in this\u00a0<a class=\"af ni\" href=\"https:\/\/github.com\/jmasengeshomsft\/azure-ml-on-aks-cli-step-by-step\" target=\"_blank\" rel=\"noopener ugc nofollow\">repo<\/a>.<\/p>\n<p data-selectable-paragraph=\"\">Follow the complete tutorial on <a href=\"https:\/\/medium.com\/@jmasengesho\/azure-machine-learning-service-for-kubernetes-architects-deploy-your-first-model-on-aks-with-az-440ada47b4a0\">Joseph&#8217;s blog<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Joseph Masengesho provides a step-by-step tutorial on how to deploy your first ML model on AKS. In a\u00a0previous post, I provided a lengthy write-up about my understanding of using Kubernetes as a compute target in Azure ML from a Kubernetes architect\u2019s perspective. In this post, I will offer a step-by-step tutorial that teaches you how [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":42077,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25,126,2824],"tags":[5332,265],"class_list":["post-42074","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-kubernetes","category-ml","tag-aks","tag-machine-learning"],"acf":[],"blog_post_summary":"<p>Joseph Masengesho provides a step-by-step tutorial on how to deploy your first ML model on AKS. In a\u00a0previous post, I provided a lengthy write-up about my understanding of using Kubernetes as a compute target in Azure ML from a Kubernetes architect\u2019s perspective. In this post, I will offer a step-by-step tutorial that teaches you how [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/42074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=42074"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/42074\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/42077"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=42074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=42074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=42074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}