Jupyter notebook recipes require you to use service principal authentication rather than providing your account credentials. There are several ways to create a Service Principal as described in following sections:
- Log in into Azure CLI 2.0
- Execute the following command
$ az ad sp create-for-rbac
Example output:
{
"appId": "...",
"displayName": "azure-cli-2017-10-27-18-45-51",
"name": "http://azure-cli-2017-10-27-18-45-51",
"password": "...",
"tenant": "..."
}
Use appId value as aad_client_id, password as aad_secret and tenant as aad_tenant during configuration file creation later.
- Log in to your Azure Account through the Azure portal.
- Select Azure Active Directory.
- To get the AAD tenant ID, select Properties and copy the Directory ID. This value is your AAD tenant ID.
- Go back to Azure Active Directory and select App registrations.
- Select New application registration.
- Provide a name and URL for the application. After setting the values, select Create.
- From App registrations in Azure Active Directory, select your application.
- Copy the Application ID and this is your AAD Client ID.
- To generate an authentication key, select you application, go to Settings and select Keys.
- Provide a description and a duration for the key. When done, select Save. After saving the key, the value of the key is displayed. Copy this value because you are not able to retrieve the key later. This is your AAD Secret.
- To assign the just created application, select the subscription you are going to use for Azure Batch AI. (You can find it from More Services -> Subscriptions)
- Select Access control (IAM)
- Select Add
- Select Contributor as the role
- Search for your application and select it.
- Select Save to finish assigning the role. You see your application in the list of users assigned to a role for that scope.
For a more detailed walk-through, please see this link.
- Log in to your Azure Account through the Azure portal.
- Select the subscription you are going to use for Azure Batch AI. (You can find it from More Services -> Subscriptions)
- Select Resource providers
- Register with Microsoft.BatchAI and Microsoft.Batch providers.
Note, a provider registration can take up to 15 minutes.
You can use two different approaches:
az role assignment create --scope /subscriptions/<your subscription id> --role "Network Contributor" --assignee 9fcb3732-5f52-4135-8c08-9d4bbaf203ea
, here 9fcb3732-5f52-4135-8c08-9d4bbaf203ea
is the service principal of Microsoft Azure BatchAI.
- Select the subscription you are going to use for Azure Batch AI. (You can find it from More Services -> Subscriptions)
- Select Access control (IAM)
- Select Add
- Select Network Contributor as the role
- Search for 'Microsoft Azure BatchAI' application and select it.
- Select Save to finish assigning the role.
- Rename configuration.json.template to configuration.json.
- Fill in your subscription Id and your AAD application information as obtained in the above step.
- Leave the "base_url" filed as empty.
- You need to specify the name of your resource group. Our recipe will automatically create resource group if it does not exist.
- Specify your Azure Storage account name and key, Please see this page.
- Batch AI creates administrator user account on every compute node and enables ssh. You need to specify user name and at least a password or ssh public key for this account.
Please follow Azure CLI 2.0 Batch AI specific documentation to install and configure Azure CLI 2.0 for using with Batch AI.
During Cluster and File Server creation you will need to specify a name and authentication method for administrator account which will be created on each compute node (you can use this account to ssh to the node).
You can provide a password and/or ssh public key as authentication method via --password (-p) and --ssh-public-key (-k) parameters.
GNU/Linux users (including Cloud Shell users) can generate authentication key for ssh using ssh-keygen
command.
Note, GNU/Linux part of recipes expects you to have a public ssh key at ~/.ssh/id_rsa.pub, if you prefer to use different ssh key, please update -k parameter value.
Training data used in recipes is compressed in zip
archives and requires unzip
utility to be installed on the host, please install it using your distribution package manager.
Cloud Shell has unzip
already installed.
If you have any problems or questions, you can reach the Batch AI team at [email protected] or you can create an issue on GitHub.
We also welcome your contributions of additional sample notebooks, scripts, or other examples of working with Batch AI.