tf environment vars for sp
This commit is contained in:
Родитель
2f6dd97856
Коммит
a01e683385
|
@ -35,12 +35,22 @@ jobs:
|
||||||
# run: az bicep build -f main.bicep
|
# run: az bicep build -f main.bicep
|
||||||
# working-directory: ${{ env.modulePath }}
|
# working-directory: ${{ env.modulePath }}
|
||||||
|
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
name: "Deploy Terraform templates"
|
name: "Deploy Terraform templates"
|
||||||
|
needs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Prepare environment variables
|
||||||
|
env:
|
||||||
|
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
run: |
|
||||||
|
# Parse Azure secret into Terraform variables
|
||||||
|
$servicePrincipal = ($env:AZURE_CREDENTIALS | ConvertFrom-Json)
|
||||||
|
$env:ARM_CLIENT_ID = $servicePrincipal.clientId
|
||||||
|
$env:ARM_CLIENT_SECRET = $servicePrincipal.clientSecret
|
||||||
|
$env:ARM_SUBSCRIPTION_ID = $servicePrincipal.subscriptionId
|
||||||
|
$env:ARM_TENANT_ID = $servicePrincipal.tenantId
|
||||||
# Checkout code
|
# Checkout code
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
|
|
Загрузка…
Ссылка в новой задаче