Skip to content

Commit eaa04bd

Browse files
committed
updated SP notebook
1 parent 5409984 commit eaa04bd

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

notebooks/Service Principal.ipynb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"source": [
5454
"import sempy_labs as labs\n",
5555
"from sempy_labs import admin\n",
56+
"from sempy_labs.tom import connect_semantic_model\n",
5657
"\n",
5758
"token_provider = labs.ServicePrincipalTokenProvider.from_azure_key_vault(\n",
5859
" key_vault_uri = '', # Enter your key vault URI\n",
@@ -79,6 +80,42 @@
7980
"source": [
8081
"admin.list_capacities(token_provider=token_provider)"
8182
]
83+
},
84+
{
85+
"cell_type": "code",
86+
"execution_count": null,
87+
"id": "a0d58c85",
88+
"metadata": {},
89+
"outputs": [],
90+
"source": [
91+
"dataset = '' # Enter the name of the semantic model\n",
92+
"workspace = None # Enter the name of the workspace\n",
93+
"with connect_semantic_model(dataset=dataset, workspace=workspace, readonly=True, token_provider=token_provider) as tom:\n",
94+
" for t in tom.model.Tables:\n",
95+
" print(t.Name)"
96+
]
97+
},
98+
{
99+
"cell_type": "markdown",
100+
"id": "27826ff4",
101+
"metadata": {},
102+
"source": [
103+
"### Use the TokenProvider to connect to Azure Analysis Services"
104+
]
105+
},
106+
{
107+
"cell_type": "code",
108+
"execution_count": null,
109+
"id": "0c21bd7e",
110+
"metadata": {},
111+
"outputs": [],
112+
"source": [
113+
"dataset = '' # Enter the name of the semantic model\n",
114+
"workspace = '' # Enter the name of the Azure Analysis Serivces instance (i.e. \"asazure://region.asazure...\")\n",
115+
"with connect_semantic_model(dataset=dataset, workspace=workspace, readonly=True, token_provider=token_provider) as tom:\n",
116+
" for t in tom.model.Tables:\n",
117+
" print(t.Name)"
118+
]
82119
}
83120
],
84121
"metadata": {

0 commit comments

Comments
 (0)