@@ -283,7 +283,7 @@ examples:
283283 async_samples\\ sample_code_eventhub_async.py )]-->\n\n <!-- literal_block {\" ids\" \
284284 : [], \" classes\" : [], \" names\" : [], \" dupnames\" : [], \" backrefs\" : [], \" source\" \
285285 : \" C:\\\\ hostedtoolcache\\\\ windows\\\\ Python\\\\ 3.11.9\\\\ x64\\\\ Lib\\\\ site-packages\\ \
286- \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure-eventhub- 5.12.1 \\\\ samples\\\\ async_samples\\ \
286+ \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure_eventhub- 5.12.2 \\\\ samples\\\\ async_samples\\ \
287287 \\ sample_code_eventhub_async.py\" , \" xml:space\" : \" preserve\" , \" force\" : false,\
288288 \ \" language\" : \" python\" , \" highlight_args\" : {\" linenostart\" : 1}, \" linenos\" \
289289 : false} -->\n\n ````python\n\n import os\n from azure.eventhub.aio import EventHubConsumerClient,\
@@ -308,15 +308,16 @@ methods:
308308 \ )]-->\n\n <!-- literal_block {\" ids\" : [], \" classes\" : [], \" names\" : [], \" \
309309 dupnames\" : [], \" backrefs\" : [], \" source\" : \" C:\\\\ hostedtoolcache\\\\ windows\\ \
310310 \\ Python\\\\ 3.11.9\\\\ x64\\\\ Lib\\\\ site-packages\\\\ py2docfx\\\\ dist_temp\\\\ \
311- 41\\\\ azure-eventhub- 5.12.1 \\\\ samples\\\\ async_samples\\\\ sample_code_eventhub_async.py\" \
311+ 41\\\\ azure_eventhub- 5.12.2 \\\\ samples\\\\ async_samples\\\\ sample_code_eventhub_async.py\" \
312312 , \" xml:space\" : \" preserve\" , \" force\" : false, \" language\" : \" python\" , \" \
313313 highlight_args\" : {\" linenostart\" : 1}, \" linenos\" : false} -->\n\n ````python\n \
314- \n import os\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n \
315- \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub.aio\
316- \ import EventHubConsumerClient\n consumer = EventHubConsumerClient.from_connection_string(\n \
317- \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n \
318- \ eventhub_name=eventhub_name # EventHub name should be specified if it\
319- \ doesn't show up in connection string.\n )\n\n logger = logging.getLogger(\" \
314+ \n import os\n from azure.identity.aio import DefaultAzureCredential\n\n \
315+ \ fully_qualified_namespace = os.environ[\" EVENT_HUB_HOSTNAME\" ]\n eventhub_name\
316+ \ = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub.aio import EventHubConsumerClient\n \
317+ \ consumer = EventHubConsumerClient(\n fully_qualified_namespace=fully_qualified_namespace,\n \
318+ \ consumer_group='$Default',\n eventhub_name=eventhub_name, # EventHub\
319+ \ name should be specified if it doesn't show up in connection string.\n \
320+ \ credential=DefaultAzureCredential()\n )\n\n logger = logging.getLogger(\" \
320321 azure.eventhub\" )\n\n async def on_event(partition_context, event):\n \
321322 \ # Put your code here.\n # If the operation is i/o intensive, async will\
322323 \ have better performance.\n logger.info(\" Received event from partition:\
@@ -563,15 +564,17 @@ methods:
563564 async_samples\\ sample_code_eventhub_async.py )]-->\n\n <!-- literal_block {\" ids\" \
564565 : [], \" classes\" : [], \" names\" : [], \" dupnames\" : [], \" backrefs\" : [], \" source\" \
565566 : \" C:\\\\ hostedtoolcache\\\\ windows\\\\ Python\\\\ 3.11.9\\\\ x64\\\\ Lib\\\\ site-packages\\ \
566- \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure-eventhub- 5.12.1 \\\\ samples\\\\ async_samples\\ \
567+ \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure_eventhub- 5.12.2 \\\\ samples\\\\ async_samples\\ \
567568 \\ sample_code_eventhub_async.py\" , \" xml:space\" : \" preserve\" , \" force\" : false,\
568569 \ \" language\" : \" python\" , \" highlight_args\" : {\" linenostart\" : 1}, \" linenos\" \
569570 : false} -->\n\n ````python\n\n import os\n from azure.eventhub.aio import\
570- \ EventHubConsumerClient\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n \
571- \ eventhub_name = os.environ['EVENT_HUB_NAME']\n consumer = EventHubConsumerClient.from_connection_string(\n \
572- \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n \
573- \ eventhub_name=eventhub_name # EventHub name should be specified if it\
574- \ doesn't show up in connection string.\n )\n\n ````\n "
571+ \ EventHubConsumerClient\n from azure.identity.aio import DefaultAzureCredential\n \
572+ \n fully_qualified_namespace = os.environ[\" EVENT_HUB_HOSTNAME\" ]\n eventhub_name\
573+ \ = os.environ['EVENT_HUB_NAME']\n consumer = EventHubConsumerClient(\n \
574+ \ fully_qualified_namespace=fully_qualified_namespace,\n credential=DefaultAzureCredential(),\n \
575+ \ consumer_group='$Default',\n eventhub_name=eventhub_name # EventHub\
576+ \ name should be specified if it doesn't show up in connection string.\n )\n \
577+ \n ````\n "
575578- uid : azure.eventhub.aio.EventHubConsumerClient.get_eventhub_properties
576579 name : get_eventhub_properties
577580 summary : " Get properties of the Event Hub.\n\n Keys in the returned dictionary include:\n \
@@ -792,7 +795,7 @@ methods:
792795 sample_code_eventhub_async.py )]-->\n\n <!-- literal_block {\" ids\" : [], \" classes\" \
793796 : [], \" names\" : [], \" dupnames\" : [], \" backrefs\" : [], \" source\" : \" C:\\\\ \
794797 hostedtoolcache\\\\ windows\\\\ Python\\\\ 3.11.9\\\\ x64\\\\ Lib\\\\ site-packages\\ \
795- \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure-eventhub- 5.12.1 \\\\ samples\\\\ async_samples\\ \
798+ \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure_eventhub- 5.12.2 \\\\ samples\\\\ async_samples\\ \
796799 \\ sample_code_eventhub_async.py\" , \" xml:space\" : \" preserve\" , \" force\" : false,\
797800 \ \" language\" : \" python\" , \" highlight_args\" : {\" linenostart\" : 1}, \" linenos\" \
798801 : false} -->\n\n ````python\n\n logger = logging.getLogger(\" azure.eventhub\" \
@@ -1000,7 +1003,7 @@ methods:
10001003 sample_code_eventhub_async.py )]-->\n\n <!-- literal_block {\" ids\" : [], \" classes\" \
10011004 : [], \" names\" : [], \" dupnames\" : [], \" backrefs\" : [], \" source\" : \" C:\\\\ \
10021005 hostedtoolcache\\\\ windows\\\\ Python\\\\ 3.11.9\\\\ x64\\\\ Lib\\\\ site-packages\\ \
1003- \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure-eventhub- 5.12.1 \\\\ samples\\\\ async_samples\\ \
1006+ \\ py2docfx\\\\ dist_temp\\\\ 41\\\\ azure_eventhub- 5.12.2 \\\\ samples\\\\ async_samples\\ \
10041007 \\ sample_code_eventhub_async.py\" , \" xml:space\" : \" preserve\" , \" force\" : false,\
10051008 \ \" language\" : \" python\" , \" highlight_args\" : {\" linenostart\" : 1}, \" linenos\" \
10061009 : false} -->\n\n ````python\n\n logger = logging.getLogger(\" azure.eventhub\" \
0 commit comments