An open API service indexing awesome lists of open source software.

https://github.com/lazauk/aifoundry-computeinstance-ssh

Brief guide on the use of SSH with the Azure AI Foundry's compute instances.
https://github.com/lazauk/aifoundry-computeinstance-ssh

Last synced: 7 months ago
JSON representation

Brief guide on the use of SSH with the Azure AI Foundry's compute instances.

Awesome Lists containing this project

README

          

# Using SSH with Azure AI Foundry's Compute Instances

[Azure AI Foundry](https://learn.microsoft.com/en-us/azure/ai-studio/) is a cloud-based platform that simplifies the development, deployment and management of artificial intelligence (AI) solutions. It provides a variety of tools and services to help you build, train and deploy AI models. One of the key components of Azure AI Foundry is compute instances. These are virtual machines that you can use to train and run your AI models.

This document provides instructions on how to use SSH to connect to Azure AI Foundry's compute instances. There are two methods for connecting: through a public network or through a private network.

## Table of Contents:
* [Part 1: Configuring SSH environment](#configuring-ssh-environment)
* [Part 2: Connecting through public network](#connecting-through-public-network)
* [Part 3: Connecting through private network](#connecting-through-private-network)

## Configuring SSH environment
1. Generate and store SSH keys in Azure:
``` bash
az sshkey create --name "AIFoundrySSHKey" --resource-group
```
> [!NOTE]
> Replace `` with the name of your Azure resource group.
2. During Compute Instance creation, select "Enable SSH Access", then "Use existing public key stored in Azure" and select the public key stored in Azure.
![UI_SSH_Config](images/AIFoundry_SSH_Config.png)
3. Optionally, you can create a new Compute Instance with disabled Public IP and enabled SSH using Azure CLI as shown below:
``` bash
az ml compute create --name --size --type ComputeInstance --resource-group --workspace-name --enable-node-public-ip False --ssh-public-access-enabled True
```
> [!NOTE]
> Replace the following placeholders with the appropriate values:
> * ``: The name of your Azure AI Foundry compute instance.
> * ``: The SKU (size) of Azure Virtual Machine.
> * ``: The name of the resource group that contains your Azure AI Foundry resource.
> * ``: The name of your Azure AI Foundry workspace.

## Connecting through public network
1. From your local machine, execute the following Az CLI command:
``` bash
az ml compute connect-ssh --name --resource-group --workspace-name --private-key-file-path
```
> [!NOTE]
> Replace the following placeholders with the appropriate values:
> * ``: The name of your Azure AI Foundry compute instance.
> * ``: The name of the resource group that contains your Azure AI Foundry resource.
> * ``: The name of your Azure AI Foundry workspace.
> * ``: The path to your private SSH key file on your local machine.

## Connecting through private network
1. Enable Private Endpoint for Azure AI Foundry to a custom VNet.
> [!WARNING]
> Private Endpoint is a "**_must_**" requirement, if you want to disable compute instance's Public IP.
> The specific steps for enabling a Private Endpoint are beyond the scope of this document. Please refer to the [Azure AI Foundry's documentation](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/configure-private-link) for detailed instructions.
2. Provision Azure VM in a custom VNet and install Az CLI. For Ubuntu-based VM, the installation of Az CLI may require execution of these commands:
``` bash
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az extension add -n ml -y
```
3. From the Azure VM, execute the following Az CLI command:
``` bash
az ml compute connect-ssh --name --resource-group --workspace-name --private-key-file-path
```
> [!NOTE]
> Replace the following placeholders with the appropriate values:
> * ``: The name of your Azure AI Foundry compute instance.
> * ``: The name of the resource group that contains your Azure AI Foundry resource.
> * ``: The name of your Azure AI Foundry workspace.
> * ``: The path to your private SSH key file on your Azure VM.

By following these steps, you should be able to use SSH to connect to your Azure AI Foundry's compute instances from either a public network or a private network.