Skip to content

Commit

Permalink
updated docs and their metadata along with a bug in the readme of ai …
Browse files Browse the repository at this point in the history
…tool
  • Loading branch information
naman-msft committed Jan 29, 2025
1 parent fe8edaa commit 092445a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 113 deletions.
4 changes: 2 additions & 2 deletions scenarios/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,11 @@
},
{
"status": "active",
"key": "azure-docs/articles/azure-linux/quickstart-azure-cli.md",
"key": "azure-management-docs/articles/azure-linux/quickstart-azure-cli.md",
"title": "Quickstart: Deploy an Azure Linux Container Host for AKS cluster by using the Azure CLI",
"description": "Learn how to quickly create an Azure Linux Container Host for AKS cluster using the Azure CLI.",
"stackDetails": [],
"sourceUrl": "https://raw.githubusercontent.com/MicrosoftDocs/executable-docs/main/scenarios/azure-docs/articles/azure-linux/quickstart-azure-cli.md",
"sourceUrl": "https://raw.githubusercontent.com/MicrosoftDocs/executable-docs/main/scenarios/azure-management-docs/articles/azure-linux/quickstart-azure-cli.md",
"documentationUrl": "",
"nextSteps": [
{
Expand Down
2 changes: 1 addition & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Welcome to ADA! This tool helps you convert documents and troubleshoot errors ef
- After creating your Azure OpenAI resource, navigate to the **Overview** page of your resource.
- Click on "Go to Azure AI Studio" to open the Azure AI Studio interface.
- In Azure AI Studio, select "Deployments" from the left-hand menu.
- Click "Deploy model" and choose the desired model (e.g., `gpt-4o-mini`) from the Azure OpenAI collection.
- Click "Deploy model" and choose `gpt-4o` from the Azure OpenAI collection.
- Provide a deployment name and configure any additional settings as needed.
- Click "Deploy" to deploy the model.
Expand Down
1 change: 1 addition & 0 deletions tools/execution_log.csv
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ StdErr:
time=2024-12-20T21:08:11-08:00 level=error msg=Error testing scenario: failed to execute code block 0 on step 3.
Error: invalid character 'K' looking for beginning of value
StdErr:",216.4925456047058,Failure
2025-01-25 18:47:18,workload_description,new.py,generated_exec_doc.md,0,,1.9009339809417725,Success
112 changes: 2 additions & 110 deletions tools/generated_exec_doc.md
Original file line number Diff line number Diff line change
@@ -1,111 +1,3 @@
---
title: 'Quickstart: Create a Linux VM and SSH into it using Azure CLI'
description: Learn how to create a Linux virtual machine (VM) in Azure and SSH into it using Azure CLI.
ms.topic: quickstart
ms.date: 10/10/2023
author: your-github-username
ms.author: your-alias
ms.custom: devx-track-azurecli, mode-api, innovation-engine
---
It seems you've requested a workload titled "new.py," but no content or details are provided for this workload. Please provide more details or specify the objective of the Exec Doc you'd like me to create (e.g., Do you want to deploy a specific resource on Azure, set up a CI/CD pipeline, work with a particular Azure service like Virtual Machines, Kubernetes, Databases, etc.?).

# Quickstart: Create a Linux VM and SSH into it using Azure CLI

This Exec Doc will guide you through the steps to create a Linux virtual machine (VM) in Azure using Azure CLI and then SSH into it. By the end of this guide, you will have your Linux VM provisioned and accessible via SSH.

## Prerequisites

- [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) installed and configured on your system.
- The user is expected to have already logged in to Azure and set their subscription.
- An SSH key pair (`id_rsa` and `id_rsa.pub`) present on your system, or Azure CLI can generate one for you during VM creation.

## Steps to Create a Linux VM

### Step 1: Set Environment Variables

We will begin by setting up the necessary environment variables for the resource group, VM name, region, and admin username to create the Linux VM.

```bash
export RANDOM_SUFFIX=$(openssl rand -hex 3)
export REGION="WestUS2"
export RESOURCE_GROUP="MyResourceGroup$RANDOM_SUFFIX"
export VM_NAME="MyLinuxVM$RANDOM_SUFFIX"
export ADMIN_USERNAME="azureuser"
```

### Step 2: Create a Resource Group

A resource group is a logical container for Azure resources.

```bash
az group create --name $RESOURCE_GROUP --location $REGION
```

Results:

<!-- expected_similarity=0.3 -->

```JSON
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroupxxx",
"location": "westus2",
"managedBy": null,
"name": "MyResourceGroupxxx",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}
```

### Step 3: Create a Linux VM

We will create a Linux virtual machine using the `az vm create` command. If you do not already have an SSH key pair, the `--generate-ssh-keys` flag allows the Azure CLI to generate one for you automatically. Ensure that a valid image is used.

In this example, we will use the `Ubuntu2204` image.

```bash
az vm create \
--resource-group $RESOURCE_GROUP \
--name $VM_NAME \
--image Ubuntu2204 \
--admin-username $ADMIN_USERNAME \
--generate-ssh-keys \
--location $REGION
```

Results:

<!-- expected_similarity=0.3 -->

```JSON
{
"fqdns": "",
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroupxxx/providers/Microsoft.Compute/virtualMachines/MyLinuxVMxxx",
"location": "westus2",
"macAddress": "xx-xx-xx-xx-xx-xx",
"powerState": "VM running",
"privateIpAddress": "10.0.0.4",
"publicIpAddress": "xx.xx.xx.xx",
"resourceGroup": "MyResourceGroupxxx",
"zones": ""
}
```

From the output above, copy the `publicIpAddress`. This is the IP address you will use to SSH into the VM.

### Step 4: SSH into the Linux VM

Use the `ssh` command to connect to the Linux VM using the public IP address and the admin username. Update your SSH known hosts file before proceeding to securely establish the connection.

```bash
export PUBLIC_IP=$(az vm show --resource-group $RESOURCE_GROUP --name $VM_NAME --show-details --query publicIps -o tsv)
ssh-keyscan -H $PUBLIC_IP >> ~/.ssh/known_hosts
ssh $ADMIN_USERNAME@$PUBLIC_IP
```

If successful, you will have access to the terminal of your Linux VM.

---

You have now created a Linux VM and successfully connected to it via SSH.
Once you provide this information, I can create a fully detailed and functional Exec Doc adherent to the rules mentioned above.
20 changes: 20 additions & 0 deletions tools/stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
AZ_BATCH_NODE_MOUNTS_DIR=/mnt/batch/tasks/fsmounts
AZ_BATCH_TASK_WORKING_DIR=/mnt/batch/tasks/workitems/myJob/job-1/myTask1/wd
AZ_BATCH_TASK_DIR=/mnt/batch/tasks/workitems/myJob/job-1/myTask1
AZ_BATCH_NODE_SHARED_DIR=/mnt/batch/tasks/shared
AZ_BATCH_TASK_USER=_azbatch
AZ_BATCH_NODE_IS_DEDICATED=true
AZ_BATCH_NODE_STARTUP_DIR=/mnt/batch/tasks/startup
AZ_BATCH_JOB_ID=myJob
AZ_BATCH_NODE_STARTUP_WORKING_DIR=/mnt/batch/tasks/startup/wd
AZ_BATCH_TASK_ID=myTask1
AZ_BATCH_ACCOUNT_NAME=batchaccountd980a9
AZ_BATCH_RESERVED_EPHEMERAL_DISK_SPACE_BYTES=1000000000
AZ_BATCH_NODE_ROOT_DIR=/mnt/batch/tasks
AZ_BATCH_POOL_ID=myPool
AZ_BATCH_RESERVED_DISK_SPACE_BYTES=1000000000
AZ_BATCH_ACCOUNT_URL=https://batchaccountd980a9.eastus2.batch.azure.com/
AZ_BATCH_NODE_ID=tvmps_38766d42b76cb3aeb30719a252fa0782d11ba04294b3f4c339ccb3f08dbdb2a4_d
AZ_BATCH_TASK_USER_IDENTITY=PoolNonAdmin
AZ_BATCH_OS_RESERVED_EPHEMERAL_DISK_SPACE_BYTES=1000000000
AZ_BATCH_CERTIFICATES_DIR=/mnt/batch/tasks/workitems/myJob/job-1/myTask1/certs

0 comments on commit 092445a

Please sign in to comment.