              │ impersonation   │       │        ┃┗━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━┷━━━━━━━━┛

For this example we will configure a service connector using the user-account auth method. But before we can do that, we need to login to GCP using the following command:

gcloud auth application-default login

This will open a browser window and ask you to login to your GCP account. Once you have logged in, you can register a new service connector using the following command:

# We want to use --auto-configure to automatically configure the service connector with the appropriate credentials and permissions to provision VMs on GCP.

zenml service-connector register gcp-skypilot-vm -t gcp --auth-method user-account --auto-configure

# using generic resource type requires disabling the generation of temporary tokens

zenml service-connector update gcp-skypilot-vm --generate_temporary_tokens=False

This will automatically configure the service connector with the appropriate credentials and permissions to provision VMs on GCP. You can then use the service connector to configure your registered VM Orchestrator stack component using the following commands:

# Register the orchestrator

zenml orchestrator register <ORCHESTRATOR_NAME> --flavor vm_gcp

# Connect the orchestrator to the service connector

zenml orchestrator connect <ORCHESTRATOR_NAME> --connector gcp-skypilot-vm

# Register and activate a stack with the new orchestrator

zenml stack register <STACK_NAME> -o <ORCHESTRATOR_NAME> ... --set

We need first to install the SkyPilot integration for Azure and the Azure extra for ZenML, using the following two commands

pip install "zenml[connectors-azure]"

zenml integration install azure skypilot_azure

To provision VMs on Azure, your VM Orchestrator stack component needs to be configured to authenticate with Azure Service Connector