An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
problem creating AKS cluster using template in Python
I have a template for creating an AKS cluster - which works when deployed via the portal - next step to run this process in code.
So, I have been looking at this azure python sample code:
https://github.com/Azure-Samples/resource-manager-python-template-deployment
The first problem is that the ServicePrincipal seems to need to have 'Owner' level to work via Python (but not via portal).
however, then it looks like the signature of the function:
ResourceManagementClient.deployments.create_or_update()
has changed subtly - if you pass in a dict for the deployment properties - as per the example code, then it produces the error message:
Exception has occurred: ValidationError
Parameter 'Deployment.properties' can not be None.
digging a bit - it looks like deployment properties now needs to be provided as an object, so I tried the following:
dprops = DeploymentProperties(mode=DeploymentMode.complete,template=aks_template,parameters=parameters)
deployment_async_operation = self.client.deployments.create_or_update(self.resource_group,'azure-sample',dprops)
this then produces the error:
Exception has occurred: CloudError
Azure Error: InvalidRequestContent
Message: The request content was invalid and could not be deserialized: 'Could not find member 'template' on object of type 'DeploymentDefinition'. Path 'template', line 1, position 12.'.
which is odd - since passing a template is really the purpose of the exercise.
when I googled this - it came up with a few hits - but relating to extensions that I am not using - as far as I know.
is there an up to date / working example of how to do this ?
A
Azure Kubernetes Service
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted comment
Comments have been turned off. Learn more