Sunday, September 10, 2023

How to create a resource group & ML workspace in Azure using azure cli (az) from local linux machine

How to create a resource group & ML workspace in Azure using azure cli (az) from local linux machine

1) Login to Azure

az login

>>> the command will ask you to authenticate the connection using a code. Finish it before next step.

2) let us list the subscriptions we have:

az account show

3) List down the azure regions:

az account list-locations

Our preferred location:
          "id": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/locations/ukwest",
          "name": "ukwest",
          "subscriptionId": null



4) Create the azure resource group:

az group create --name "rg-dp100-labs" --location "ukwest"

output:

(azcli) [vagrant@localhost ~]$ az group create --name "rg-dp100-labs" --location "ukwest"
{
  "id": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs",
  "location": "ukwest",
  "managedBy": null,
  "name": "rg-dp100-labs",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}
(azcli) [vagrant@localhost ~]$


5) List the available resource groups:

Command:

az group list

Output:

(azcli) [vagrant@localhost ~]$ az group list
[
  {
    "id": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs",
    "location": "ukwest",
    "managedBy": null,
    "name": "rg-dp100-labs",
    "properties": {
      "provisioningState": "Succeeded"
    },
    "tags": null,
    "type": "Microsoft.Resources/resourceGroups"
  }
]
(azcli) [vagrant@localhost ~]$


6) Create Azure ML workspace

az ml workspace create --name "mlw-dp100-labs" -g "rg-dp100-labs"

Actual output:

(azcli) [vagrant@localhost ~]$ az ml workspace create --name "mlw-dp100-labs" -g "rg-dp100-labs"
Class ManagedNetwork: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
The deployment request mlw-dp100-labs-6349534 was accepted. ARM deployment URI for reference:
https://portal.azure.com//#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F67ed360b-95af-4a7f-b398-f459c8118cc1%2FresourceGroups%2Frg-dp100-labs%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fmlw-dp100-labs-6349534
Creating Log Analytics Workspace: (mlwdp100logalyti0d1ce113  ) ..  Done (16s)
Creating Application Insights: (mlwdp100insightsef9fc48f  )  Done (18s)
Creating Key Vault: (mlwdp100keyvault9db8214d  )  Done (24s)
Creating Storage Account: (mlwdp100storageb8dadeb6f  )   Done (28s)
Creating AzureML Workspace: (mlw-dp100-labs  ) ..  Done (18s)
Total time : 47s
Class ManagedNetworkSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
Class ManagedNetworkStatusSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
{
  "application_insights": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.insights/components/mlwdp100insightsef9fc48f",
  "description": "mlw-dp100-labs",
  "discovery_url": "https://ukwest.api.azureml.ms/discovery",
  "display_name": "mlw-dp100-labs",
  "enable_data_isolation": false,
  "hbi_workspace": false,
  "id": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.MachineLearningServices/workspaces/mlw-dp100-labs",
  "identity": {
    "principal_id": "64a46edf-9d6d-4f59-837a-d7d2eb5079c2",
    "tenant_id": "4e050b03-5c99-495a-8385-689d04c7baed",
    "type": "system_assigned"
  },
  "key_vault": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.Keyvault/vaults/mlwdp100keyvault9db8214d",
  "location": "ukwest",
  "managed_network": {
    "isolation_mode": "disabled",
    "outbound_rules": []
  },
  "mlflow_tracking_uri": "azureml://ukwest.api.azureml.ms/mlflow/v1.0/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.MachineLearningServices/workspaces/mlw-dp100-labs",
  "name": "mlw-dp100-labs",
  "public_network_access": "Enabled",
  "resourceGroup": "rg-dp100-labs",
  "resource_group": "rg-dp100-labs",
  "storage_account": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.Storage/storageAccounts/mlwdp100storageb8dadeb6f",
  "tags": {
    "createdByToolkit": "cli-v2-1.9.0"
  }
}
(azcli) [vagrant@localhost ~]$


7) Verify the azure ml worskspace existance

az ml workspace list

(azcli) [vagrant@localhost ~]$ az ml workspace list
Class ManagedNetworkSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
Class ManagedNetworkStatusSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
[
  {
    "application_insights": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.insights/components/mlwdp100insightsef9fc48f",
    "description": "mlw-dp100-labs",
    "discovery_url": "https://ukwest.api.azureml.ms/discovery",
    "display_name": "mlw-dp100-labs",
    "enable_data_isolation": false,
    "hbi_workspace": false,
    "id": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.MachineLearningServices/workspaces/mlw-dp100-labs",
    "identity": {
      "principal_id": "64a46edf-9d6d-4f59-837a-d7d2eb5079c2",
      "tenant_id": "4e050b03-5c99-495a-8385-689d04c7baed",
      "type": "system_assigned"
    },
    "key_vault": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.Keyvault/vaults/mlwdp100keyvault9db8214d",
    "location": "ukwest",
    "managed_network": {
      "isolation_mode": "disabled",
      "outbound_rules": []
    },
    "mlflow_tracking_uri": "azureml://ukwest.api.azureml.ms/mlflow/v1.0/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.MachineLearningServices/workspaces/mlw-dp100-labs",
    "name": "mlw-dp100-labs",
    "public_network_access": "Enabled",
    "resourceGroup": "rg-dp100-labs",
    "resource_group": "rg-dp100-labs",
    "storage_account": "/subscriptions/67ed360b-95af-4a7f-b398-f459c8118cc1/resourceGroups/rg-dp100-labs/providers/Microsoft.Storage/storageAccounts/mlwdp100storageb8dadeb6f",
    "tags": {
      "createdByToolkit": "cli-v2-1.9.0"
    }
  }
]
(azcli) [vagrant@localhost ~]$

No comments:

Post a Comment

Flashback data archive steps

 Objective: Ways to track DML changes in a table Detailed objective: We should be able to track the changes in the table at any point in tim...