Several organizations today are using data as a strategic asset to gain a competitive edge. There has been a significant increase in the adoption and implementation of artificial intelligence (AI) & machine learning (ML) strategies globally.
But are all these projects successful?
A recent survey revealed that 36% to 56% of AI and ML projects fail to deliver. Various friction points exist around technology, preventing businesses from gaining the data-driven insights required to achieve the desired results.
Using Azure MLOps, you can streamline the ML lifecycle and bridge the gap between software development and production. Azure Machine Learning allows you to integrate with the Azure DevOps pipeline to automate ML lifecycle processes at the production level.
In this article, you’ll learn how to set up MLOps projects in Azure ML.
Table of Contents:
- What Is Azure MLOps?
- Azure MLOps Features
- Prerequisites to Setup Azure MLOps Pipeline
- Azure DevOps Setup
- Source Repository Setup with Azure DevOps
- Deploying Azure Infrastructure Pipeline via Azure DevOps
- Wrapping Up!
What Is Azure MLOps?
Azure Machine Learning Operations (MLOps) allows businesses to adopt and manage MLOps pipelines in the Azure Cloud. With Azure, ML engineers and data scientists can manage MLOps and produce, train, test, and deploy ML models as per their business needs.
Azure ML offers multiple asset management tools to manage the ML lifecycle – from initialization to deployment. What’s more, you can also develop models in the Azure ML workspace.
In short, Azure ML, which contains the MLOps platform, serves the entire ML lifecycle on a single platform.
Azure MLOps Features
Azure ML allows you to create machine learning pipelines that define repeatable and reusable steps to prepare and train data. You can develop a reusable software environment to package, train, register, and deploy machine-learning models from any location.
Other significant features include:
With Azure MLOps pipeline, you can automate the complete ML lifecycle, test new deep learning models, update existing models, and periodically roll out new ML models with your applications and services.
2. Model Tracking
Azure ML allows you to capture governance information for your ML lifecycle and track metadata. It lets you add various information to the logged lineage data, like the model’s publisher and when the model was deployed and used in production.
By integrating Azure ML with Git, you can track data on the branches and repositories. You can also track the complete audit trail of all machine learning assets using metadata.
Prerequisites to Setup Azure MLOps Pipeline
- An Azure subscription and Azure ML workspace. You can sign in to the Azure portal (https://portal.azure.com) and create an Azure subscription if you don’t have one.
- Git operating on your local system.
- Access to DevOps services.
- An Azure DevOps project to host the pipelines and source repositories.
- If you’re using Terraform + Azure DevOps to spin up infrastructure, you will require the Terraform extension for Azure DevOps.
Azure DevOps Setup
Below is a step-by-step guide to setting up Azure DevOps:
- Sign in to your Azure DevOps account.
- Create a new project by entering the project name and description. Select the “Private” option under the visibility settings.
- Go to the bottom left of the project page to access Project Settings and select Service Connections.
- Click on “Create service connection”.
- Go to Azure Resource Manager, click on “Next,” and choose Service Principal (manual). Click on “Next” and choose the Scope Level Subscription.
- Fill in all the required details: Subscription ID, Subscription Name, Service Principal Key, Service Principal ID, and Tenant ID.
- Now, name the service connection. For example, you can name the connection – Azure-ARM-Prod.
- Choose “Grant access permission to all pipelines” and then click on “Verify and Save.”
With this, you’re Azure DevOps setup is completed.
Source Repository Setup with Azure DevOps
After finishing the Azure DevOps setup, follow these steps to set up the source repository with Azure DevOps:
- Sign in to your Azure DevOps account and open the project you created.
- Go to the Repos section and choose Import Repository.
- Select “Git” under the Repository type and enter the clone URL. Now, click on “Import”.
- Go to the bottom of the left-hand navigation pane and open the Project Settings.
- Choose Repositories under the Repos section and select the repository that you imported in step 3. Now, click on the Security tab.
- Choose the “ProjectName Build Service User” option under the User Permission section. Change the Create Branch permission to Allow and the Contribute permission to Allow.
- Go to the Pipelines section in the left-hand navigation pane and click on the three vertical dots next to the “Create Pipeline” option. Choose Manage Security from the dropdown menu.
- Under the Users section, choose the “ProjectName Build Service” account. Change the permission status for Edit Build Pipeline from “Not Set” to “Allow.”
With this, you’ve completed the prerequisite section.
Deploying Azure Infrastructure Pipeline via Azure DevOps
In this step, you’ll deploy the training pipeline to the Azure ML workspace that you created in earlier steps.
- Open your repository and select the main branch of the repo. Choose the “config-infra-prod.yml” file under the contents section. Fill in the namespace, postfix, and location section in the config file to your liking.
- Choose commit and then click on push code to include these values into the pipeline.
- Open the Pipelines section and choose Create Pipeline.
- Choose Azure Repos Git.
- Choose the repository that you imported in the preceding section.
- Click on the Existing Azure Pipelines YAML file.
- Choose the main branch and select your pipeline, then click on Continue.
- You can now run the pipeline. This will take a few minutes to complete. The pipeline will generate the following:
- The Azure Machine Learning Workspace along with the Resource Group, Container Registry, Storage Account, Keyvault, and Application Insights.
- A computer cluster is also created in the Workspace.
With this, your Azure MLOps project infrastructure is deployed.
We hope you now have an idea of how to automate your machine learning pipeline in Azure ML using Azure DevOps. By following the steps mentioned above and utilizing Azure’s services and tools, you can improve collaboration and ensure the scalability and reliability of your deep learning models.
As AI learning and MLOps continue to evolve, you must stay up-to-date with the latest industry trends and Azure offerings to further optimize your machine learning operations.
If you want to conquer the cloud and scale your applications, Hurix Digital can help! Our team of seasoned professionals can help you develop cloud-native, scalable solutions that grow with your needs. We also offer end-to-end cloud platform managed services, including architecting the solution, regular optimization, and active management.
Schedule a demo with us today and watch your digital infrastructure soar!