what is the connection string for opencensus.ext.azure.log_exporter AzureLogHandler in…
- User
what is the connection string for opencensus.ext.azure.log_exporter AzureLogHandler in azure ml ?
- Assistant
The connection string for opencensus.ext.azure.log_exporter AzureLogHandler in Azure ML can be obtained from the Azure portal.
-
Go to your Azure portal and navigate to your resource group that contains your Azure Machine Learning workspace.
-
Click on your workspace and navigate to the "Workspace settings" blade.
-
Under "Workspace endpoints", copy the "Primary Storage account key" and "Primary Storage account name".
-
Construct the connection string using the primary storage account name and key:
DefaultEndpointsProtocol=https;AccountName=[primaryStorageAccountName];AccountKey=[primaryStorageAccountKey];EndpointSuffix=core.windows.netReplace
[primaryStorageAccountName]and[primaryStorageAccountKey]with the values copied from the workspace settings. -
Use the constructed connection string in the
instrument()method for theAzureLogHandler:from opencensus.ext.azure.log_exporter import AzureLogHandler connection_string = "DefaultEndpointsProtocol=https;AccountName=[primaryStorageAccountName];AccountKey=[primaryStorageAccountKey];EndpointSuffix=core.windows.net" logger = logging.getLogger(__name__) logger.addHandler(AzureLogHandler(connection_string=connection_string))
-