Azure Kubernetes token based authentication to ML webservice

8/21/2019

I'm able to deploy ML model into Azure Kubernetes Services using AML services. I have enabled token authentication while deploying model into AKS. As mentioned in the document "https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-enterprise-security" 2 ways authentication(Key and token) is possible to consume ML model webservice, deployed in Azure Kubernetes services. To consume the webservice. we have to provide the token along with the service request. But I couldn’t find any document how to generate/get token from Kubernetes services. How to get the new token every time whenever call is made from client application to the model running in the Azure Kubernetes services. It would be great help if you could able to provide more information on this.

-- Raghu naik
azure
azure-kubernetes
azure-machine-learning-service
kubernetes

1 Answer

8/30/2019

Once you have enabled token authentication, you fetch the token by fetching the service and invoking get_token() method on it. An example of this is available at: https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-enterprise-security#authentication-with-tokens.

token, refresh_by = service.get_token()
print(token)
-- Parth Shah
Source: StackOverflow