File: ml_samples_test_prepForSign.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (31 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from azure.identity import (
    DefaultAzureCredential,
    AzureCliCredential,
    InteractiveBrowserCredential,
)
from azure.ai.ml import MLClient, load_job
from azure.ai.ml.entities import Data, ManagedOnlineEndpoint, Job, CommandComponent
from azure.ai.ml.sweep import SweepJob, GridSamplingAlgorithm, Choice, Objective
from azure.ai.ml import command
from azure.ai.ml.constants import AssetTypes
from azure.ai.ml.entities._load_functions import load_component

subscription_id = "2d385bf4-0756-4a76-aa95-28bf9ed3b625"
resource_group = "sdkv2-20240925-rg"
workspace_name = "sdkv2-20240925-ws"


credential = DefaultAzureCredential()

print(credential)
ml_client = MLClient(
    credential=credential,
    subscription_id=subscription_id,
    resource_group_name=resource_group,
    workspace_name=workspace_name,
)

component = load_component(
    "C:\\Projects\\azure-sdk-for-python\\sdk\\ml\\azure-ai-ml\\azure\\ai\\ml\\YAMLsigning\\sum1.yaml"
)
ml_client.components.prepare_for_sign(component)