<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need To Create Report From CSV File using it's APIs in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Need-To-Create-Report-From-CSV-File-using-it-s-APIs/m-p/4585636#M39817</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="821902" data-lia-user-login="UmeshGoti" class="lia-mention lia-mention-user"&gt;UmeshGoti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's a step-by-step solution that combines the Power BI REST API with cloud storage (S3/Azure Blob) to fully automate the generation of reports with semantic models and visualizations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cloud Storage Configuration:&lt;BR /&gt;Azure Blob example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;from azure.storage.blob import BlobServiceClient

connection_string = "your_azure_connection_string"
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
container_client = blob_service_client.get_container_client("reports")

blob_client = container_client.upload_blob("data.csv", open("local_data.csv", "rb"))
sas_token = blob_client.generate_sas(permissions="r", expiry=datetime.utcnow() + timedelta(hours=2))
csv_url = f"{blob_client.url}?{sas_token}"
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Use the Power BI REST API to create datasets and define table structures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To create a dataset :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/datasets
Authorization: Bearer [Access Token]
Content-Type: application/json

{
  "name": "SalesDataset",
  "tables": [
    {
      "name": "Sales",
      "columns": [
        {"name": "Date", "dataType": "datetime"},
        {"name": "Product", "dataType": "string"},
        {"name": "Revenue", "dataType": "Int64"}
      ]
    }
  ]
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load CSV data into the dataset:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/tables/Sales/rows
Authorization: Bearer [Access Token]
Content-Type: application/json

{
  "rows": [
    {"Date": "2024-01-01", "Product": "A", "Revenue": 1000},
    {"Date": "2024-01-02", "Product": "B", "Revenue": 1500}
  ]
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Jianpeng &lt;/SPAN&gt;&lt;SPAN&gt;Li&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post &lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2025 06:24:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-02-26T06:24:38Z</dc:date>
    <item>
      <title>Need To Create Report From CSV File using it's APIs</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Need-To-Create-Report-From-CSV-File-using-it-s-APIs/m-p/4560171#M39801</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I have requirement to generate powerbi report including visual part or semantic layer by having CSV as datasource through poewrBi API's .&lt;BR /&gt;Generated report will fetch data from CSV and CSV can be stored in some storage space like Amazon S3 Bucket or Azure Storage through some APIs of PowerBi.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As currently i am reading out documentations i think we can use Gateways of PowerBi(&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-deployment-guidance" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-deployment-guidance&lt;/A&gt;)&lt;BR /&gt;and may be semantic layer creation api(&lt;A href="https://learn.microsoft.com/en-us/rest/api/fabric/semanticmodel/items/create-semantic-model?tabs=HTTP" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/rest/api/fabric/semanticmodel/items/create-semantic-model?tabs=HTTP&lt;/A&gt;) to create semantic model&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can some one please help on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 05:00:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Need-To-Create-Report-From-CSV-File-using-it-s-APIs/m-p/4560171#M39801</guid>
      <dc:creator>UmeshGoti</dc:creator>
      <dc:date>2025-02-25T05:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need To Create Report From CSV File using it's APIs</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Need-To-Create-Report-From-CSV-File-using-it-s-APIs/m-p/4585636#M39817</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="821902" data-lia-user-login="UmeshGoti" class="lia-mention lia-mention-user"&gt;UmeshGoti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here's a step-by-step solution that combines the Power BI REST API with cloud storage (S3/Azure Blob) to fully automate the generation of reports with semantic models and visualizations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cloud Storage Configuration:&lt;BR /&gt;Azure Blob example:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;from azure.storage.blob import BlobServiceClient

connection_string = "your_azure_connection_string"
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
container_client = blob_service_client.get_container_client("reports")

blob_client = container_client.upload_blob("data.csv", open("local_data.csv", "rb"))
sas_token = blob_client.generate_sas(permissions="r", expiry=datetime.utcnow() + timedelta(hours=2))
csv_url = f"{blob_client.url}?{sas_token}"
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Use the Power BI REST API to create datasets and define table structures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To create a dataset :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/datasets
Authorization: Bearer [Access Token]
Content-Type: application/json

{
  "name": "SalesDataset",
  "tables": [
    {
      "name": "Sales",
      "columns": [
        {"name": "Date", "dataType": "datetime"},
        {"name": "Product", "dataType": "string"},
        {"name": "Revenue", "dataType": "Int64"}
      ]
    }
  ]
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Load CSV data into the dataset:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/tables/Sales/rows
Authorization: Bearer [Access Token]
Content-Type: application/json

{
  "rows": [
    {"Date": "2024-01-01", "Product": "A", "Revenue": 1000},
    {"Date": "2024-01-02", "Product": "B", "Revenue": 1500}
  ]
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Jianpeng &lt;/SPAN&gt;&lt;SPAN&gt;Li&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post &lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 06:24:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Need-To-Create-Report-From-CSV-File-using-it-s-APIs/m-p/4585636#M39817</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-26T06:24:38Z</dc:date>
    </item>
  </channel>
</rss>

