# Installation of NBA AI/ML Engine

To install NBA AI/ML Engine, follow the steps below:

**Download the NBA AI/ML Engine (Azure Managed Application)**\
&#x20;

* Once you click on Install it will navigate you to the NBA AI/ML Engine page, click Get it now to begin the deployment process.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FBnfHxmtC50qSnaeRdC3L%2F1..png?alt=media&#x26;token=459f5d9b-1389-4897-9124-b7696fe02e04" alt=""><figcaption></figcaption></figure>

* &#x20;A confirmation prompt appears. Click '**Get it now**' again to confirm.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FJyJm3W3DWrb5IeoTJh6e%2F2..png?alt=media&#x26;token=7568acd1-5873-42e0-93ca-a724871fecf4" alt=""><figcaption></figcaption></figure>

&#x20;

**Select Subscription and Create**

* Select your active Azure subscription from the subscription dropdown. (You must have an active subscription to proceed.)&#x20;
* Click **Create** to continue to the deployment configuration UI.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FnGBDlmI8FPz4WQhIrZ0G%2F3..png?alt=media&#x26;token=28b78e40-6522-479b-82d2-3039a9a376dd" alt=""><figcaption></figcaption></figure>

**Basics Tab - Resource Group & Names**<br>

* Create a new Resource Group OR select an existing Resource Group.
* Important: If you select an existing resource group, it must be empty. If it contains resources, create a new resource group instead.
* Enter the Container App name and Managed Application name.

{% hint style="info" %}
**Note**: The Container App name will appear in the URL of the created container app. Choose it carefully.&#x20;
{% endhint %}

* Enter the Object ID of the deploying user.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F8cqD6TJplQB9cdJ4CGxr%2F5..png?alt=media&#x26;token=69a313ee-7896-465c-840e-7c59f3b12831" alt=""><figcaption></figcaption></figure>

* To get the Object ID, go to the Azure portal, search for Microsoft Entra ID.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F7RzdjaZX4KHx7ByP3IBo%2F6..png?alt=media&#x26;token=afa882c5-b1b3-404b-acb6-47c6a4c7e8b3" alt=""><figcaption></figcaption></figure>

* Click **Manage → Users**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FJy7QRwXixjMRb0q9fim1%2F7..png?alt=media&#x26;token=badcc92a-8e42-480e-951a-105269be8a94" alt=""><figcaption></figcaption></figure>

* Click **All users → Search for your username and select it.**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FGLmc4wc5LMkSzXQaSWPl%2F8..png?alt=media&#x26;token=54702cee-8ac6-484b-ac46-3c9d9844242a" alt=""><figcaption></figcaption></figure>

* Copy the **Object ID**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FrDXn0WlSUhTEb5qpz02a%2F9..png?alt=media&#x26;token=c1bb754d-6e9d-4aa6-b525-fe8a34d5a7ea" alt=""><figcaption></figcaption></figure>

* Paste your Object ID and click **Next**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F6ETmxQxRAPxH76NHkiMV%2F10..png?alt=media&#x26;token=bf93ca6c-2a80-47c5-9ca5-a1b518374e32" alt=""><figcaption></figcaption></figure>

#### **OpenAI Service Configuration Tab**

Move to the Open AI service configuration tab. You will be prompted to choose an option (Yes / No).

### **If you select No:**

* The NBA AI/ML Engine will create an Azure AI service for you and deploy the model into that service automatically.
* From the dropdown, select the model you want to deploy and select/set the token for that model.
* Set the token value based on your requirements and the tokens available in your Azure subscription. (Ensure you have sufficient tokens/quota for the chosen model.)
* Click **Next** to proceed.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FczcuYw7VWkBsTKx1CJ7y%2F11..png?alt=media&#x26;token=1786efb2-0dce-40f1-bf9e-32b5bbb126a2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FEy85q7ddvUegojLGp18Y%2F12..png?alt=media&#x26;token=fd1a788d-f1ef-48c8-b102-2d03a0e98e14" alt=""><figcaption></figcaption></figure>

#### **Finalize Deployment**

* Review all configuration selections (subscription, resource group, container app name, OpenAI configuration, model and token, environment, owner).
* Complete the deployment (click **Create / Deploy** as applicable in the Azure UI).

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FOi5ClmdiBpGyg6nAYWqV%2F13..png?alt=media&#x26;token=d1fcdf05-4bb0-4a32-8ab9-f68be9790eb8" alt=""><figcaption></figcaption></figure>

&#x20;

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FaXGOzAG4Z51gTjse8iOk%2F14..png?alt=media&#x26;token=eeda9195-ba2f-456e-bb28-bdaef6c1a3bd" alt=""><figcaption></figcaption></figure>

* This will create a managed application in the selected Azure subscription. After successful deployment user must open the managed application.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FYYOZUKLzzFzTs1ZwjGUN%2F15..png?alt=media&#x26;token=e6143751-652a-46ec-9fce-7d5dc3403641" alt=""><figcaption></figcaption></figure>

### **If you select Yes:**

* In the Azure OpenAI Service dropdown, all existing Azure OpenAI services will be listed. Select the service you want to use.

**Note:** The Azure service must have at least one deployed chat completion model

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FU9IWD5hWYzs5LBmcdXK8%2F1..png?alt=media&#x26;token=b7ab3181-b76f-4585-b939-3ed30865a8f0" alt=""><figcaption></figcaption></figure>

* Select the **Model Deployment Name** and **Azure OpenAI API Version**, then click **Next**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FdROTssj8RMn44QAuPCjV%2F2..png?alt=media&#x26;token=2b242a4f-851f-4695-a563-807ed0661853" alt=""><figcaption></figcaption></figure>

* Go to:  \
  **Home → ChatCompletionService → Access Control (IAM) → Add Role Assignment**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FKVx4OW4BJZKXHVrkwgZg%2F3..png?alt=media&#x26;token=74d4050c-14f7-40e2-8f75-6af4c4c66567" alt=""><figcaption></figcaption></figure>

* Under **Roles**, select **Cognitive Services OpenAI User**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2Fy0GpfecbXKT1KmoI2vaW%2F4..png?alt=media&#x26;token=aa0ef016-722a-457a-b2dc-447647ec46e5" alt=""><figcaption></figcaption></figure>

* Under **Members**, choose **Assign access to Managed Identity**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FHlmzgYkkcJsQeRDB7bGX%2F5..png?alt=media&#x26;token=a8ab4eb7-df77-46fa-81dd-c098d4284671" alt=""><figcaption></figcaption></figure>

* To get the managed identity name:

  \
  Go to the **Azure** Portal and search for **Managed Applications**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FQzDK13xzjwZlgnwA82td%2F6..png?alt=media&#x26;token=1f4a8ab8-9b08-4cc1-ad68-e78ea47ac520" alt=""><figcaption></figcaption></figure>

* Open it and search for the deployed NBA AI/ML engine (**NBAEngine**).

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FH6uBf4BHUz9I9xY1sruX%2F7..png?alt=media&#x26;token=faf541bf-da6f-48ba-9b90-7badca4ceb9b" alt=""><figcaption></figcaption></figure>

* Open the **Managed resource group** from that application.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2Fmx8hAcH3A44rSvBZzRyz%2F8..png?alt=media&#x26;token=a69ab9d0-a66b-4a67-bdba-530e2d6e44f7" alt=""><figcaption></figcaption></figure>

* Look for the **Managed Identity** under resources and copy its name.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FueFdFX6dm283v0Y5QXBp%2F9..png?alt=media&#x26;token=1118e91b-d944-48a3-aa60-04a985cd4d10" alt=""><figcaption></figcaption></figure>

* Paste the name into **Managed Identity**, then:

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FRSa12Y3op8QzzgYXprx0%2F10..png?alt=media&#x26;token=e22eecfb-0f7c-46fe-acec-3dccdebb8794" alt=""><figcaption></figcaption></figure>

* Click **Select**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F8hF4wMtRd6NB8lLMSICn%2F11..png?alt=media&#x26;token=2e1f62d6-9370-48a7-9648-704dcd3cf834" alt=""><figcaption></figcaption></figure>

* Click **Review+assign**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FsL0MeWnhU4vQJDmJ3v4o%2F12..png?alt=media&#x26;token=7e960df7-113a-45e7-a8b3-0b27ae79e3d7" alt=""><figcaption></figcaption></figure>

* After assigning:

Open the Managed Resource Group again.

Locate and open the **Azure Machine Learning Workspace**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F9D8AzLWBvKm1a4cLS1sV%2F13..png?alt=media&#x26;token=9a188002-6b92-4dc2-bb5f-3c3ed2b9047f" alt=""><figcaption></figcaption></figure>

* Under the **Manage** section, open the **Studio Web URL**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FI3UmBmd8b2S9EBos3z5w%2F14..png?alt=media&#x26;token=1a60af8c-c018-4bfe-b4d8-319cfd9864c1" alt=""><figcaption></figcaption></figure>

* Go to **Manage** -> **Compute**
* Scroll down and find System Assigned Identity
* Copy the Principal ID

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FBUa0hhRaIlILPIWDU9tH%2F15..png?alt=media&#x26;token=918b582d-16cd-4652-a091-90aa4606fa18" alt=""><figcaption></figcaption></figure>

* Now go back and:

Click **Members** → Assign access to **User, Group, or Service Principal**

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2F4GLTsBan260TXNx6DR8z%2F16..png?alt=media&#x26;token=ca471e9a-e2ea-48b5-809f-1800bc168e89" alt=""><figcaption></figcaption></figure>

* Paste the **Principal ID**.
* Click **Select**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FADx32XOZT6WlMrijMYe6%2F17..png?alt=media&#x26;token=51929ad6-45c0-4f2d-851f-ee4bf284447c" alt=""><figcaption></figcaption></figure>

* Click **Review + Assign**.

<figure><img src="https://272130504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0QoyqUVI8_HaZ9FOSL%2Fuploads%2FzQi7XZdMR1H4dxQibbsW%2F18..png?alt=media&#x26;token=c8072604-1f64-420a-8e28-f51bbf5412af" alt=""><figcaption></figcaption></figure>

* Click Here to configure the NBA AI/ML Engine.
