Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to refresh a dataset in Power BI Service which uses Python script connector as a source ?

Hi,

I've a report which uses Python script connector as a source. Below is the example of the code.

 

 

 

import requests
import json
import pandas as pd

authentication_url = "https://name.api.yyyymanager.com/Authentication/AuthorizeUser"

credentials = {
                "Username":"Sha******ya",
                "Password":"*********"
            }
response = requests.post(authentication_url,json=credentials)
token = str(response.content)[3:-2]

headers = {
            'Content-Type':'application/json',
            'Accept':'application/json',
            'X-RM12Api-ApiToken':token
        }

# Property Insurance
dataset_url = "https://name.api.yyyymanager.com/ReportWriterReports/218/RunReportWriterReport"
response = requests.get(url=dataset_url,headers=headers)
data = json.loads(response.content)
property_insurance = pd.DataFrame(data['Rows'])
property_insurance = property_insurance[['name','Property Insurance Expiration']]

 

 

 

Using this script we get the data in power bi and based on it we create our visual.

Now when I deploy it in Power BI Service and try to schedule the refresh of the dataset I get the below error at the dataset setting page.

Shahabh786lnt_0-1678157057132.png

 

Please suggest how can I schedule refresh for a dataset which uses Python script connector as a data source.

0 REPLIES 0

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors