-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user does not have permission to call the Discover method #305
Comments
Seems like an access issue. The strange this is that the discover objects are not used to do this. Can you do this? from sempy_labs.tom import connect_semantic_model
with connect_semantic_model(dataset='', workspace='', readonly=True) as tom:
print(tom.model.Model.Name) |
HI,
I got this error:
…---------------------------------------------------------------------------
AmoException Traceback (most recent call last)
Cell In[13], line 3
1 from sempy_labs.tom import connect_semantic_model
----> 3 with connect_semantic_model(dataset='LinePlan', workspace='testFabric', readonly=True) as tom:
4 print(tom.model.Model.Name)
File ~/cluster-env/trident_env/lib/python3.11/contextlib.py:137, in _GeneratorContextManager.__enter__(self)
135 del self.args, self.kwds, self.func
136 try:
--> 137 return next(self.gen)
138 except StopIteration:
139 raise RuntimeError("generator didn't yield") from None
File /nfs4/pyenv-f02d29df-38d0-489a-ad88-9b0b9102e641/lib/python3.11/site-packages/sempy_labs/tom/_model.py:4615, in connect_semantic_model(dataset, readonly, workspace)
4612 workspace_id = fabric.get_workspace_id()
4613 workspace = fabric.resolve_workspace_name(workspace_id)
-> 4615 tw = TOMWrapper(dataset=dataset, workspace=workspace, readonly=readonly)
4616 try:
4617 yield tw
File /nfs4/pyenv-f02d29df-38d0-489a-ad88-9b0b9102e641/lib/python3.11/site-packages/sempy_labs/tom/_model.py:50, in TOMWrapper.__init__(self, dataset, workspace, readonly)
45 self._tables_added = []
47 self._tom_server = fabric.create_tom_server(
48 readonly=readonly, workspace=workspace
49 )
---> 50 self.model = self._tom_server.Databases.GetByName(dataset).Model
52 self._table_map = {}
53 self._column_map = {}
AmoException: The 'Database' with 'Name' = 'LinePlan' doesn't exist in the collection.
at Microsoft.AnalysisServices.NamedComponentCollection.BaseGetByName(String name, Boolean throwIfNotFound)
at Microsoft.AnalysisServices.Tabular.DatabaseCollection.GetByName(String name)
This is the workspace and dataset I’m trying to process:
***@***.***
Thanks in advance
Lorenzo.
Da: m-kovalsky ***@***.***>
Inviato: martedì 26 novembre 2024 17:19
A: microsoft/semantic-link-labs ***@***.***>
Cc: Lorenzo Danielli ***@***.***>; Author ***@***.***>
Oggetto: Re: [microsoft/semantic-link-labs] user does not have permission to call the Discover method (Issue #305)
Seems like an access issue. The strange this is that the discover objects are not used to do this.
Can you do this?
from sempy_labs.tom import connect_semantic_model
with connect_semantic_model(dataset='', workspace='', readonly=True) as tom:
print(tom.model.Model.Name)
—
Reply to this email directly, view it on GitHub<#305 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHNT6D52XM5KRKC6FDBMGN32CSNPLAVCNFSM6AAAAABSQZZG6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBRGI4TCNBZGU>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Yes it was…should I enable it?
Thanks!
Da: m-kovalsky ***@***.***>
Inviato: domenica 1 dicembre 2024 10:59
A: microsoft/semantic-link-labs ***@***.***>
Cc: Lorenzo Danielli ***@***.***>; Author ***@***.***>
Oggetto: Re: [microsoft/semantic-link-labs] user does not have permission to call the Discover method (Issue #305)
Is this tenant setting disabled?
image.png (view on web)<https://github.com/user-attachments/assets/3b3c2e68-718c-4fd5-b029-f49de152c69c>
—
Reply to this email directly, view it on GitHub<#305 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHNT6D2OQP63GVFT6NBKYXT2DLMVZAVCNFSM6AAAAABSQZZG6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBZGY3DKNJQGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Don't enable that. Is the model on a shared capacity? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI,
I tried to run the commands but I can't move forward since I get this error:
OperationException Traceback (most recent call last) Cell In[13], line 1----> 1 migration.create_pqt_file(dataset = dataset_name, workspace = workspace_name) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/migration/_create_pqt_file.py:52, in create_pqt_file(dataset, workspace, file_name) 49 subFolderPath = os.path.join(folderPath, "pqtnewfolder") 50 os.makedirs(subFolderPath, exist_ok=True)---> 52 with connect_semantic_model( 53 dataset=dataset, workspace=workspace, readonly=True 54 ) as tom: 55 if not any( 56 p.SourceType == TOM.PartitionSourceType.M for p in tom.all_partitions() 57 ) and not any(t.RefreshPolicy for t in tom.model.Tables): 58 print( 59 f"{icons.info} The '{dataset}' semantic model within the '{workspace}' workspace has no Power Query logic." 60 ) File ~/cluster-env/trident_env/lib/python3.11/contextlib.py:137, in _GeneratorContextManager.enter(self) 135 del self.args, self.kwds, self.func 136 try:--> 137 return next(self.gen) 138 except StopIteration: 139 raise RuntimeError("generator didn't yield") from None File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/tom/_model.py:4579, in connect_semantic_model(dataset, readonly, workspace) 4576 workspace_id = fabric.get_workspace_id() 4577 workspace = fabric.resolve_workspace_name(workspace_id)-> 4579 tw = TOMWrapper(dataset=dataset, workspace=workspace, readonly=readonly) 4580 try: 4581 yield tw File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy_labs/tom/_model.py:47, in TOMWrapper.init(self, dataset, workspace, readonly) 44 self._readonly = readonly 45 self._tables_added = []---> 47 self._tom_server = fabric.create_tom_server( 48 readonly=readonly, workspace=workspace 49 ) 50 self.model = self._tom_server.Databases.GetByName(dataset).Model 52 self._table_map = {} File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/fabric/_flat.py:1488, in create_tom_server(readonly, workspace) 1485 workspace_url = _get_workspace_url(workspace_client.get_workspace_name()) 1486 connection_str = _build_adomd_connection_string(workspace_url, readonly=readonly)-> 1488 return _create_tom_server(connection_str, workspace_client.token_provider) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/_utils/_log.py:310, in mds_log..get_wrapper..log_decorator_wrapper(*args, **kwargs) 307 raise 309 try:--> 310 result = func(*args, **kwargs) 312 # The invocation for get_message_dict moves after the function 313 # so it can access the state after the method call 314 message.update(extractor.get_completion_message_dict(result, arg_dict)) File /nfs4/pyenv-37980388-9737-41fc-8dbb-c078cd639d85/lib/python3.11/site-packages/sempy/fabric/_client/_utils.py:49, in _create_tom_server(connection_string, token_provider) 46 tom_server.AccessToken = get_access_token(None) 47 tom_server.OnAccessTokenExpired = FuncAccessToken, AccessToken---> 49 tom_server.Connect(connection_string) 51 return tom_server OperationException: The ' USER_NAME' user does not have permission to call the Discover method. Technical Details: RootActivityId: b0384b69-0319-4dd6-bb26-f73f21136342 Date (UTC): 11/4/2024 2:22:31 PM at Microsoft.AnalysisServices.XmlaClient.CheckForSoapFault(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError) at Microsoft.AnalysisServices.XmlaClient.CheckForError(XmlReader reader, XmlaResult xmlaResult, Boolean throwIfError) at Microsoft.AnalysisServices.XmlaClient.SendMessage(Boolean endReceivalIfException, Boolean readSession, Boolean readNamespaceCompatibility) at Microsoft.AnalysisServices.Core.AnalysisServicesClient.Discover(IMajorObject obj, ObjectExpansion expansion, JaXmlSerializer serializer) at Microsoft.AnalysisServices.Core.Server.Refresh(IMajorObject obj, ObjectExpansion expansion) at Microsoft.AnalysisServices.Core.Server.SendRefresh(IMajorObject obj, ObjectExpansion expansion) at Microsoft.AnalysisServices.MajorObject.Refresh(ObjectExpansion expansion) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId, ObjectExpansion expansionType) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId) at Microsoft.AnalysisServices.Core.Server.Connect(String connectionString)
The logged user is a power platform admin and an analysis service admin.
Can anyone suggest me what else to check in order to understand the reason behind this?
Thanks a lot
Lorenzo
The text was updated successfully, but these errors were encountered: