<?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: Loading data from dataframe to Azure Storage Queue/Message Queue. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5109#M1621</link>
    <description>&lt;P&gt;@Sanjoy Sen​&amp;nbsp;: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it is possible to load the data from a DataFrame into Azure Storage Queue/Message Queue. Here's one possible approach:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Convert the DataFrame into a JSON string using the toJSON() method.&lt;/LI&gt;&lt;LI&gt;Use the Azure Storage Queue/Message Queue client library for Python to create a queue client object and send the JSON string as a message to the queue. You will need to authenticate with the Azure storage account using a connection string or credentials.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's some example code to get you started:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import json
from azure.storage.queue import QueueClient
&amp;nbsp;
# Convert the DataFrame to a JSON string
json_data = df.toJSON().collect()
&amp;nbsp;
# Create a queue client object
queue_client = QueueClient.from_connection_string(conn_str="&amp;lt;your-connection-string&amp;gt;", queue_name="&amp;lt;your-queue-name&amp;gt;")
&amp;nbsp;
# Send the JSON string as a message to the queue
for data in json_data:
    message = json.dumps(data)
    queue_client.send_message(message)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the above code, replace &amp;lt;your-connection-string&amp;gt; with the connection string for your Azure storage account and &amp;lt;your-queue-name&amp;gt; with the name of your queue. Also, make sure to handle any errors or exceptions that may occur during the message sending process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 17:32:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-28T17:32:54Z</dc:date>
    <item>
      <title>Loading data from dataframe to Azure Storage Queue/Message Queue.</title>
      <link>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5107#M1619</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We do have one use case where we have batch load that create a dataframe at end and now we want to load this data at Azure Storage Queue/Message Queue so that some Rest API can read the data/messages from the queue later and process it accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible ? If not, what would be the best approach to follow here.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:27:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5107#M1619</guid>
      <dc:creator>sensanjoy</dc:creator>
      <dc:date>2023-04-27T17:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from dataframe to Azure Storage Queue/Message Queue.</title>
      <link>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5108#M1620</link>
      <description>&lt;P&gt;@Suteja Kanuri​&amp;nbsp; looking for your input here. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 16:26:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5108#M1620</guid>
      <dc:creator>sensanjoy</dc:creator>
      <dc:date>2023-04-28T16:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from dataframe to Azure Storage Queue/Message Queue.</title>
      <link>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5109#M1621</link>
      <description>&lt;P&gt;@Sanjoy Sen​&amp;nbsp;: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it is possible to load the data from a DataFrame into Azure Storage Queue/Message Queue. Here's one possible approach:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Convert the DataFrame into a JSON string using the toJSON() method.&lt;/LI&gt;&lt;LI&gt;Use the Azure Storage Queue/Message Queue client library for Python to create a queue client object and send the JSON string as a message to the queue. You will need to authenticate with the Azure storage account using a connection string or credentials.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's some example code to get you started:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import json
from azure.storage.queue import QueueClient
&amp;nbsp;
# Convert the DataFrame to a JSON string
json_data = df.toJSON().collect()
&amp;nbsp;
# Create a queue client object
queue_client = QueueClient.from_connection_string(conn_str="&amp;lt;your-connection-string&amp;gt;", queue_name="&amp;lt;your-queue-name&amp;gt;")
&amp;nbsp;
# Send the JSON string as a message to the queue
for data in json_data:
    message = json.dumps(data)
    queue_client.send_message(message)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the above code, replace &amp;lt;your-connection-string&amp;gt; with the connection string for your Azure storage account and &amp;lt;your-queue-name&amp;gt; with the name of your queue. Also, make sure to handle any errors or exceptions that may occur during the message sending process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 17:32:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5109#M1621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-28T17:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from dataframe to Azure Storage Queue/Message Queue.</title>
      <link>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5110#M1622</link>
      <description>&lt;P&gt;@Suteja Kanuri​&amp;nbsp; excellent and I would like to thank you once again. &lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2023 04:59:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/loading-data-from-dataframe-to-azure-storage-queue-message-queue/m-p/5110#M1622</guid>
      <dc:creator>sensanjoy</dc:creator>
      <dc:date>2023-04-29T04:59:23Z</dc:date>
    </item>
  </channel>
</rss>

