Github Action to register an Azure Machine Learning Model in a workspace.
Features:
- Register a model in an Azure Machine Learning workspace
- Checks if the model already exists in the workspace
- Checks if the resource group and workspace exist
For other Azure Machine Learning actions check out:
- create-azure-machine-learning-online-endpoint
- create-azure-machine-learning-online-deployment
- move-azure-machine-learning-model-to-registry
- register-azure-machine-learning-model-to-workspace
- Authenticate using Azure Login
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Register model in Azure Machine Learning workspace
uses: coding-kitties/[email protected]
with:
model_name: '<model-name>'
model_version: '<model-version>'
resource_group: '<resource-group>'
workspace_name: '<workspace-name>'
model_path: '<path-to-model>'
This example demonstrates an Azure Machine Learning Deployment with blue/green deployments for different environments. We use various Github Actions to create a complete workflow.
name: Release Azure Machine Learning Model
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
MODEL_NAME: '<model-name>'
MODEL_VERSION: '<model-version>'
RESOURCE_GROUP: '<resource-group>'
WORKSPACE_NAME: '<workspace-name>'
ENDPOINT_NAME: '<endpoint-name>'
MODEL_PATH: '<path-to-model>'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Azure CLI login
uses: Azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Register model in Azure Machine Learning workspace
- name: Register model in Azure Machine Learning workspace
uses: coding-kitties/[email protected]
with:
model_name: ${{ env.MODEL_NAME }}
model_version: ${{ env.MODEL_VERSION }}
resource_group: ${{ env.RESOURCE_GROUP }}
workspace_name: ${{ env.WORKSPACE_NAME }}
model_path: ${{ env.MODEL_PATH }}
# Create Azure Machine Learning Online Endpoint
- name: Create AML Online Endpoint
uses: coding-kitties/[email protected]
with:
endpoint_name: ${{ env.ENDPOINT_NAME }}
resource_group: ${{ env.RESOURCE_GROUP }}
workspace_name: ${{ env.WORKSPACE_NAME }}