|
53 | 53 | "source": [ |
54 | 54 | "import sempy_labs as labs\n", |
55 | 55 | "from sempy_labs import admin\n", |
| 56 | + "from sempy_labs.tom import connect_semantic_model\n", |
56 | 57 | "\n", |
57 | 58 | "token_provider = labs.ServicePrincipalTokenProvider.from_azure_key_vault(\n", |
58 | 59 | " key_vault_uri = '', # Enter your key vault URI\n", |
|
79 | 80 | "source": [ |
80 | 81 | "admin.list_capacities(token_provider=token_provider)" |
81 | 82 | ] |
| 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 | + ] |
82 | 119 | } |
83 | 120 | ], |
84 | 121 | "metadata": { |
|
0 commit comments