最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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:

发布评论

评论列表(0)

  1. 暂无评论