Forum Discussion
Simultaneous Access to Embedded Power BI Report Across Multiple URLs Leads to Parameter Overwrite
Hi Anonymous ,
I think this is classified as a session independence issue and you can refer to the following suggestions.
1. Use unique parameter names for each user session. For example, append a session-specific identifier to the parameter name to avoid conflicts.
2. Ensure that API calls for updating parameters and refreshing datasets apply to specific user sessions. This may require adding session-specific headers or parameters to the API request.
Here is a simplified example
def update_parameters(workspace_id, dataset_id, parameters, session_id):
url = f"https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/datasets/{dataset_id}/Default.UpdateParameters"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {access_token}"
}
payload = {
"updateDetails": [
{
"name": f"{param['name']}_{session_id}",
"newValue": param['value']
} for param in parameters
]
}
response = requests.post(url, headers=headers, json=payload)
return response.json()
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
As per your Suggestion, I passed the baseurl and sessionid in the request body of update-parameter API for each baseurl it's sessionid is unique.
Scenario: When one request comes in and is still in progress, and another request arrives at the same time, the parameter gets updated. However, since the refresh takes a bit of time, the parameter from the first request gets replaced by the parameter from the second request. During the refresh of the first request, it picks up the parameter from the second request and updates it.
The issue occurs because, in the image below, only one parameter is stored at a time. If a new parameter arrives, it stores that parameter, and the refresh process for the old parameter remains pending, causing it to take the new parameter instead.