Search code examples
azurevisual-studioazure-functions

Visual Studio 2022 Azure Function publish profile creation failed


I have created a simple Azure Function triggered by service bus queue messages. It works on my local and I can see the break point hit. However, when I try to publish it to Azure I get this error - Publish profile creation failed.

Here is the Azure Function project which shows this error. https://github.com/SunnyMittal/Func.ServiceBusMessageProcessor

Any ideas on how to publish Azure Function using Visual Studio?

I have set up Azure service authentication to my user account that has owner permission on the Azure subscription.

enter image description here

Here is the input that I used to provision the Azure function via VS 2022.

enter image description here

It seems to create the Azure resources fine as I can see them created in the Azure portal.

enter image description here

When I try to create a publish profile again same error happens at the end as shown by below steps.

  1. enter image description here
  2. enter image description here
  3. enter image description here
  4. enter image description here

Solution

  • There were multiple credentials in Visual Studio, I removed all of them except the one with the owner privileges in the Azure subscription and then it worked.

    It worked with this remaining:

    enter image description here