Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ensure bicep is upgraded #1593

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .azure/modules/redis/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ module privateDnsZone '../privateDnsZone/main.bicep' = {

module privateDnsZoneGroup '../privateDnsZoneGroup/main.bicep' = {
name: '${namePrefix}-redis-privateDnsZoneGroup'
dependsOn: [
privateDnsZone
]
params: {
name: 'default'
dnsZoneGroupName: 'privatelink-redis-cache-windows-net'
Expand Down
3 changes: 0 additions & 3 deletions .azure/modules/serviceBus/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ module privateDnsZone '../privateDnsZone/main.bicep' = {

module privateDnsZoneGroup '../privateDnsZoneGroup/main.bicep' = {
name: '${namePrefix}-service-bus-privateDnsZoneGroup'
dependsOn: [
privateDnsZone
]
params: {
name: 'default'
dnsZoneGroupName: 'privatelink-servicebus-windows-net'
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/azure-login/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Azure Login with Bicep Upgrade'
description: 'Login to Azure and upgrade Bicep CLI'

inputs:
client-id:
description: 'Azure Client ID'
required: true
tenant-id:
description: 'Azure Tenant ID'
required: true
subscription-id:
description: 'Azure Subscription ID'
required: true
env:
AZ_CLI_VERSION: 2.67.0
runs:
using: "composite"
steps:
- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
with:
client-id: ${{ inputs.client-id }}
tenant-id: ${{ inputs.tenant-id }}
subscription-id: ${{ inputs.subscription-id }}

- name: Upgrade Azure Bicep
shell: bash
run: az bicep upgrade
18 changes: 7 additions & 11 deletions .github/workflows/workflow-deploy-apps.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: Deploy apps
env:
AZ_CLI_VERSION: 2.67.0
on:
workflow_call:
outputs:
Expand Down Expand Up @@ -67,8 +65,8 @@ jobs:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4

- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
- name: Azure Login
uses: ./.github/actions/azure-login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down Expand Up @@ -119,7 +117,6 @@ jobs:
uses: azure/CLI@v2
if: ${{!inputs.dryRun}}
with:
azcliversion: ${{ env.AZ_CLI_VERSION }}
inlineScript: |
az containerapp job start -n ${{ steps.deploy.outputs.name }} -g ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}

Expand All @@ -129,7 +126,6 @@ jobs:
id: verify-migration
timeout-minutes: 3
with:
azcliversion: ${{ env.AZ_CLI_VERSION }}
inlineScript: |
./.github/tools/containerAppJobVerifier.sh ${{ steps.deploy.outputs.name }} ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} ${{ inputs.version }}

Expand Down Expand Up @@ -162,12 +158,13 @@ jobs:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4

- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
- name: Azure Login
uses: ./.github/actions/azure-login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Dryrun Deploy app ${{ matrix.name }}(${{ inputs.environment }})
uses: azure/arm-deploy@v2
if: ${{ inputs.dryRun }}
Expand Down Expand Up @@ -223,7 +220,6 @@ jobs:
id: verify-deployment
timeout-minutes: 3
with:
azcliversion: ${{ env.AZ_CLI_VERSION }}
inlineScript: |
./.github/tools/revisionVerifier.sh ${{ steps.deploy.outputs.revisionName }} ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}

Expand Down Expand Up @@ -252,8 +248,8 @@ jobs:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4

- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
- name: Azure Login
uses: ./.github/actions/azure-login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/workflow-deploy-infra.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
name: Deploy infrastructure

env:
AZ_CLI_VERSION: 2.67.0

on:
workflow_call:
secrets:
Expand Down Expand Up @@ -63,8 +59,8 @@ jobs:
with:
ref: ${{ inputs.ref }}

- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
- name: Azure Login
uses: ./.github/actions/azure-login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand All @@ -74,7 +70,6 @@ jobs:
uses: azure/CLI@v2
id: keyvault-keys
with:
azcliversion: ${{ env.AZ_CLI_VERSION }}
inlineScript: |
KEY_VAULT_KEYS=$(az keyvault secret list --vault-name ${{ secrets.AZURE_SOURCE_KEY_VAULT_NAME }} --subscription ${{ secrets.AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID }} --query "[].name" -o json | tr -d '\n')
echo "::set-output name=key-vault-keys::$KEY_VAULT_KEYS"
Expand Down
Loading