@@ -0,0 +1,2377 @@
+import azurerm%0Afrom cryptography.hazmat.primitives import serialization%0Afrom cryptography.hazmat.primitives.asymmetric import rsa%0Afrom cryptography.hazmat.backends import default_backend%0Afrom haikunator import Haikunator  # used to generate random word strings%0Aimport json%0Aimport sys%0A%0A# Load Azure app defaults%0Atry:%0A    with open('azurermconfig.json') as configFile:%0A        configData = json.load(configFile)%0Aexcept FileNotFoundError:%0A    print(%22Error: Expecting vmssConfig.json in current folder%22)%0A    sys.exit()%0A%0Atenant_id = configData%5B'tenantId'%5D%0Aapp_id = configData%5B'appId'%5D%0Aapp_secret = configData%5B'appSecret'%5D%0Asubscription_id = configData%5B'subscriptionId'%5D%0A%0A# authenticate%0Aaccess_token = azurerm.get_access_token(tenant_id, app_id, app_secret)%0A%0Alocation = 'eastus'%0A%0A# create resource group%0Argname = Haikunator.haikunate()%0Aprint('Creating resource group: ' + rgname)%0Aresponse = azurerm.create_resource_group(access_token, subscription_id, rgname, location)%0Aif response.status_code != 201:%0A    print(json.dumps(response.json(), sort_keys=False, indent=2, separators=(',', ': ')))%0A    sys.exit('Expecting return code 201 from create_resource_group(): ')%0A%0A# create Container Service name and DNS values%0Aservice_name = Haikunator.haikunate(delimiter='')%0Aagent_dns = Haikunator.haikunate(delimiter='')%0Amaster_dns = Haikunator.haikunate(delimiter='')%0A%0A# generate RSA Key for container service%0Akey = rsa.generate_private_key(backend=default_backend(), public_exponent=65537, %5C%0A    key_size=2048)%0Apublic_key = key.public_key().public_bytes(serialization.Encoding.OpenSSH, %5C%0A    serialization.PublicFormat.OpenSSH).decode('utf-8')%0A%0A# create container service%0Aagent_count = 3%0Aagent_vm_size = 'Standard_A1'%0Amaster_count = 1%0Aadmin_user = 'azure'%0Aprint('Creating container service: ' + service_name)%0Aprint('Agent DNS: ' + agent_dns)%0Aprint('Master DNS: ' + master_dns)%0Aprint('Agents: ' + str(agent_count) + ' * ' + agent_vm_size)%0Aprint('Master count: ' + str(master_count))%0A%0Aresponse = azurerm.create_container_service(access_token, subscription_id, %5C%0A    rgname, service_name, agent_count, agent_vm_size, agent_dns, %5C%0A    master_dns, admin_user, public_key, location, master_count=master_count)%0Aif response.status_code != 201:%0A    sys.exit('Expecting return code 201 from create_resource_group()')%0A%0Aprint(json.dumps(response.json(), sort_keys=False, indent=2, separators=(',', ': ')))

Add ACS example