Create main code.yml #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: .github/workflows/workflow.yml | |
name: Run Azure Login with User-assigned Managed Identity | |
on: [push] | |
jobs: | |
build-and-deploy: | |
runs-on: self-hosted | |
steps: | |
- name: Azure login | |
uses: azure/login@v2 | |
with: | |
auth-type: IDENTITY | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
enable-AzPSSession: true | |
# Azure CLI Action only supports linux self-hosted runners for now. | |
# If you want to execute the Azure CLI script on a windows self-hosted runner, you can execute it directly in `run`. | |
- name: Azure CLI script | |
uses: azure/cli@v2 | |
with: | |
azcliversion: latest | |
inlineScript: | | |
az account show | |
- name: Azure PowerShell script | |
uses: azure/powershell@v2 | |
with: | |
azPSVersion: "latest" | |
inlineScript: | | |
Get-AzContext |