How to provision a new Azure Function with bicep pipeline and service principle?

Khalid Hajjouji 40 Reputation points
2025-04-09T07:42:38.38+00:00

I have a new Azure subscription. I dont have access to the portal (portal.azure.com). I have only a service principal. How can I create a new Azure Function with a bicep pipeline with a service principal? I already have a bicep, yaml and azure function files.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,705 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Deepanshukatara-6769 15,275 Reputation points
    2025-04-09T08:06:39.9433333+00:00

    Hello , Welcome to MS Q&A

    To create a new Azure Function using a Bicep pipeline with a service principal, you can follow these steps using Azure CLI:

    1. Log in with the Service Principal: Use the following command to log in to Azure using your service principal credentials:
       az login --service-principal --username <appId> --password <password> --tenant <tenantId>
       
    
    1. Deploy the Bicep Template: Once logged in, you can deploy your Bicep template to create the Azure Function. Use the following command:
       az deployment group create --resource-group <resourceGroup> --template-file <bicepFile> --parameters <parameters>
       
    

    Replace <resourceGroup>, <bicepFile>, and <parameters> with your specific resource group name, Bicep file path, and any parameters required for your deployment.

    These steps will help you deploy your Azure Function using the Bicep template with the service principal you have

    Please let me know if you have ques

    Kindly accept if it helps

    Thanks

    Deepanshu


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.