To use Azure Login action with OIDC, you need to configure a federated identity credential on a Microsoft Entra application or a user-assigned managed identity.
You need to provide your application's Client ID, Directory (tenant) ID, and Subscription ID to the login action. These values can either be provided directly in the workflow or can be stored in GitHub secrets and referenced in your workflow. Saving the values as GitHub secrets is the more secure option.
Select Security > Secrets and variables > Actions.
Select New repository secret.
Note
To enhance workflow security in public repositories, use environment secrets instead of repository secrets. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it.
Create secrets for AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_SUBSCRIPTION_ID. Copy these values from your Microsoft Entra application or user-assigned managed identity for your GitHub secrets:
GitHub secret
Microsoft Entra application or user-assigned managed identity
AZURE_CLIENT_ID
Client ID
AZURE_SUBSCRIPTION_ID
Subscription ID
AZURE_TENANT_ID
Directory (tenant) ID
Note
For security reasons, we recommend using GitHub Secrets rather than passing values directly to the workflow.
The Bicep file requires one parameter called storagePrefix with 3 to 11 characters.
You can put the file anywhere in the repository. The workflow sample in the next section assumes the Bicep file is named main.bicep, and it's stored at the root of your repository.
Create workflow
A workflow defines the steps to execute when triggered. It's a YAML (.yml) file in the .github/workflows/ path of your repository. The workflow file extension can be either .yml or .yaml.
To create a workflow, take the following steps:
From your GitHub repository, select Actions from the top menu.
Select New workflow.
Select set up a workflow yourself.
Rename the workflow file if you prefer a different name other than main.yml. For example: deployBicepFile.yml.
Replace the content of the yml file with the following code:
Replace mystore with your own storage account name prefix.
Note
You can specify a JSON format parameters file instead in the ARM Deploy action (example: .azuredeploy.parameters.json).
The first section of the workflow file includes:
name: The name of the workflow.
on: The name of the GitHub events that triggers the workflow. The workflow is triggered when there's a push event on the main branch.
Select Commit changes.
Select Commit directly to the main branch.
Select Commit new file (or Commit changes).
Updating either the workflow file or Bicep file triggers the workflow. The workflow starts right after you commit the changes.
Check workflow status
Select the Actions tab. You see a Create deployBicepFile.yml workflow listed. It takes 1-2 minutes to run the workflow.
Select the workflow to open it, and verify the Status is Success.
Clean up resources
When your resource group and repository are no longer needed, clean up the resources you deployed by deleting the resource group and your GitHub repository.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
In this quickstart, you learn how to configure continuous integration in Azure Pipelines by using Bicep and bicepparam files. It shows how to use an Azure CLI task to deploy a bicepparam file.