Azure agent creation
#1 Updated by Tanvi Marballi over 4 years ago
Reference to the Azure Python SDK: https://azure-sdk-for-python.readthedocs.io/en/latest/
1) Add azure as an infrastructure in the AppScalefile and provide the user credentials file to access the account.
2) Credentials needed for basic authentication: subscriptionID, appID, appSecret & tenantID (Pass these in the JSON file).
3) Add a base azure agent which is able to authenticate using the credentials provided.
a) The application should have a ServicePrincipal created as a prerequisite from the azure CLI with the appropriate "Contributor" role before accessing it from the azure agent code.
b) Use the adal library for auth token
c) Create an instance to the ServicePrincipalCredentials (Credentials) to access any resources.
d) Create a default or use an existing ResourceGroup.
e) Create a StorageAccount associated with the ResourceGroup.
f) Create a Network Interface.
g) Create a Virtual Machine using the ResourceGroup, StorageAccount and the NetworkInterface. (http://azure-sdk-for-python.readthedocs.io/en/latest/resourcemanagementcomputenetwork.html)