ການຕັ້ງຄ່າ proxy ຂອງ Service Bus trigger ໃນ Azure Functions ໃນ host.json
ໃຊ້ webProxy ໃນ host.json ຂອງ Service Bus extension 5.x ກັບ amqpWebSockets, ແທນການຕັ້ງຄ່າ ServiceBusClient ອື່ນໃນລະຫັດ function.
{
"version": "2.0",
"extensions": {
"serviceBus": {
"transportType": "amqpWebSockets",
"webProxy": "http://proxy.example:8080"
}
}
}ລວມສິ່ງນີ້ເຂົ້າໃນການຕັ້ງຄ່າ host ຂອງ Functions ທີ່ມີຢູ່. binding extension ສ້າງ client ຂອງ trigger; client ທີ່ສ້າງແຍກຕ່າງຫາກໃນລະຫັດ function ບໍ່ໄດ້ແທນມັນ.
Extension 5.x ຮອງຮັບ webProxy ກັບ amqpWebSockets, ບໍ່ແມ່ນ amqpTcp. ເກັບ namespace/authentication ໄວ້ໃນການຕັ້ງຄ່າການເຊື່ອມຕໍ່ Service Bus ທີ່ມີຢູ່. ສຳລັບ Service Bus namespace ສາທາລະນະທີ່ອະນຸຍາດໃຫ້ມີຕົວກາງສາທາລະນະ, ລາຍຊື່ proxy HTTP ສະໜອງຜູ້ສະໝັກສຳລັບ URL webProxy ທີ່ບໍ່ມີບັນຊີ.
ຄ່າທຽບເທົ່າໃນການຕັ້ງຄ່າແອັບຯແມ່ນ:
AzureFunctionsJobHost__extensions__serviceBus__transportType=amqpWebSockets
AzureFunctionsJobHost__extensions__serviceBus__webProxy=http://proxy.example:8080ໃຊ້ລຳດັບຊັ້ນສອງເສັ້ນລຸ່ມນັ້ນໃນການຕັ້ງຄ່າສະພາບແວດລ້ອມ, ຫຼືລາຍການໃນໄຟລ໌ local.settings.json, ພາກສ່ວນ Values, ສຳລັບການພັດທະນາທ້ອງຖິ່ນ. ສິ່ງເຫຼົ່ານີ້ແມ່ນການຕັ້ງຄ່າ host, ບໍ່ແມ່ນຊ່ອງ connection string.
ປັບໃຫ້ກົງກັບລຸ້ນ extension ທີ່ຕິດຕັ້ງ. client HTTP ຫຼື Service Bus ທີ່ເປັນເອກະລາດຂອງ worker ທີ່ແຍກອອກຍັງຕ້ອງການເສັ້ນທາງຂອງຕົນເອງ.