python - "3:26:25 PM: Error: This request is not authorized to perform this operation." - Stack Overflow

I am trying to deploy a basicdummy service bus trigger in my function app, but I am getting this error

I am trying to deploy a basic/dummy service bus trigger in my function app, but I am getting this error:

3:26:25 PM: Error: This request is not authorized to perform this operation.

I want it to deploy in the function app and I want to check the logs, I have checked the role assigned to me which is the contributor role.

I am trying to deploy a basic/dummy service bus trigger in my function app, but I am getting this error:

3:26:25 PM: Error: This request is not authorized to perform this operation.

I want it to deploy in the function app and I want to check the logs, I have checked the role assigned to me which is the contributor role.

Share Improve this question edited Feb 3 at 1:31 NoXMan 1252 bronze badges asked Jan 31 at 10:15 Reethu MaddiReethu Maddi 1 1
  • Check grammar and spelling before posting – BanAnanas Commented Jan 31 at 16:52
Add a comment  | 

1 Answer 1

Reset to default 0

If you have enabled managed identity in function App, make sure identity has the necessary permissions such as Azure Service Bus Data Receiver to access the Service Bus.

  • Validate Connection String to access the Service Bus.

  • Ensure your function app has required permissions at the resource group or subscription level.

  • Make sure Service Bus setup has no access restrictions or network restrictions.

Deploy the function App using the function core tools in command line. Command to deploy the function to Azure: func azure functionapp publish functionappname.

I have created a Python Service Bus queue trigger Azure function.

Add ServiceBusConnectionString with service bus connection string as an application setting under Function App's configuration.

Code:

app = func.FunctionApp()

@app.service_bus_queue_trigger(arg_name="azservicebus", queue_name="queue1",
                               connection="ServiceBusConnectionString") 
def servicebus_trigger(azservicebus: func.ServiceBusMessage):
    logging.info('Python ServiceBus Queue trigger processed a message: %s',
                azservicebus.get_body().decode('utf-8'))

Deployed function to Azure:

Portal:

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745269483a4619656.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信