if (FALSE) {
rg <- AzureRMR::get_azure_login()$
get_subscription("subscription_id")$
get_resource_group("rgname")
myaks <- rg$get_aks("mycluster")
# sync with Azure: AKS resource creation can take a long time, use this to track status
myaks$sync_fields()
# get the cluster endpoint
kubclus <- myaks$get_cluster()
# list of agent pools
myaks$list_agent_pools()
# create a new agent pool, then delete it
pool <- myaks$create_agent_pool("pool2", 3, size="Standard_DS3_v2")
pool$delete()
# refresh the service principal password (mostly for legacy clusters without a managed identity)
myaks$update_service_password()
# refresh the service principal password, using custom credentials to authenticate with MS Graph
# arguments here are for Graph, not AKS!
myaks$update_service_password(app="app_id", password="app_password")
}
Run the code above in your browser using DataLab