azure_ml_sdk.services.connection.authenticate ============================================= .. py:module:: azure_ml_sdk.services.connection.authenticate Classes ------- .. autoapisummary:: azure_ml_sdk.services.connection.authenticate.Authenticator Module Contents --------------- .. py:class:: Authenticator(subscription_id: str, resource_group: str, workspace_name: str) Class for setting up authentication for Azure Machine Learning resources and workflows. Different methods can be used in authentication: Local authentication, interactive authentication, and Service Principal. .. attribute:: subscription_id Azure Subscription ID. :type: str .. attribute:: resource_group Azure resource group name. :type: str .. attribute:: workspace_name Azure ML workspace name. :type: str .. py:attribute:: subscription_id .. py:attribute:: resource_group .. py:attribute:: workspace_name .. py:method:: default_connection() -> Optional[azure.ai.ml.MLClient] Authenticate locally with DefaultAzureCredential. This method is used in experimentation and iterative developments. :returns: MLClient instance if success. :rtype: MLClient .. py:method:: interactive_connection() -> Optional[azure.ai.ml.MLClient] Authenticate interactively with InteractiveBrowserCredential. This method opens an interactive browser for connection. :returns: MLClient instance if success. :rtype: MLClient .. py:method:: service_principal_connection(tenant_id, client_id, client_secret) -> Optional[azure.ai.ml.MLClient] Authenticate using a Service principal with ClientSecrterCredential. This method is best suited for automated process without user interaction. :param tenant_id: Tenant ID of the Service principal application. :type tenant_id: str :param client_id: ID of the Service principal application. :type client_id: str :param client_secret: Secret ID of the Service principal application. :type client_secret: str :returns: MLClient instance if success. :rtype: MLClient .. py:method:: managed_identity_connection(client_id: Optional[str] = None) -> Optional[azure.ai.ml.MLClient] Authenticate using Managed Identity. This method supports both system-assigned and user-assigned managed identities. For system-assigned managed identity, leave client_id as None. For user-assigned managed identity, provide the client_id. :param client_id: The client ID of the user-assigned managed identity. Leave as None for system-assigned managed identity. :type client_id: Optional[str] :returns: MLClient instance if success. :rtype: MLClient .. py:method:: workload_identity_connection(tenant_id: Optional[str] = None, client_id: Optional[str] = None) -> Optional[azure.ai.ml.MLClient] Authenticate using Workload Identity Federation. This method is designed for Azure DevOps pipelines that use Workload Identity Federation. If running in Azure DevOps with properly configured federation, the tenant_id and client_id parameters are optional as they will be automatically detected. :param tenant_id: The Azure AD tenant ID. Optional if running in Azure DevOps. :type tenant_id: Optional[str] :param client_id: The client ID of the federated application. Optional if running in Azure DevOps. :type client_id: Optional[str] :returns: MLClient instance if success. :rtype: MLClient