Skip to content

Instantly share code, notes, and snippets.

@SaschaDittmann
Last active September 16, 2022 13:17
Show Gist options
  • Save SaschaDittmann/3a5f60345ff57e42db25d39d5ec49185 to your computer and use it in GitHub Desktop.
Save SaschaDittmann/3a5f60345ff57e42db25d39d5ec49185 to your computer and use it in GitHub Desktop.
DevOps for Machine Learning (Azure MLOps Part 5) - Deploy Your Model to Azure Kubernetes Service
az extension add -n azure-cli-ml
existingaks=$(az ml computetarget list -g $(azureml.resourceGroup) -w $(azureml.workspaceName) --query "[?name=='$(aks.clusterName)'].name" -o tsv)
[[ -z "$existingaks" ]] && az ml computetarget create aks -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -n $(aks.clusterName) -s $(aks.vmSize) -a $(aks.agentCount) || echo "compute target already exists, skipping..."
az ml model deploy -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -n $(service.name.production) -f ../metadata/model.json --dc aksDeploymentConfig.yml --ic inferenceConfig.yml --ct $(aks.clusterName) --overwrite
$(System.DefaultWorkingDirectory)/_MLOps-YouTube-CI/drop/setup/install_requirements.sh
pytest integration_test.py --doctest-modules --junitxml=junit/test-results.xml --cov=integration_test --cov-report=xml --cov-report=html --scoreurl $(az ml service show -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -n $(service.name.production) --query scoringUri -o tsv) --scorekey $(az ml service get-keys -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -n $(service.name.production) --query primaryKey -o tsv)
@anjibabupalla
Copy link

Hi,
Thanks, it is very useful. I have a situation where I would like to attach the blob in deployment (aks). If you can let me know how we can do that, it will be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment