55 JFROG_CREDENTIAL_PLUGIN_BINARY_URL :
66 description : ' BINARY_URL (CI adds arch suffix automatically)'
77 required : true
8- default : " https://releases .jfrog.io/artifactory/run/jfrog-credentials- provider/0.1.0-beta.1 /jfrog-credential-provider-aws-linux "
8+ default : " https://partnership .jfrog.io/artifactory/credential- provider-test /jfrog-credential-provider"
99 type : string
1010 DISABLE_TERRAFORM_DESTROY :
1111 description : ' DISABLE_TERRAFORM_DESTROY'
4242 run : |
4343 aws sts get-caller-identity
4444
45+ - name : Login to Azure with Federated Credentials
46+ uses : azure/login@v1
47+ with :
48+ client-id : ${{ secrets.AZURE_APP_CLIENT_ID }}
49+ tenant-id : ${{ secrets.AZURE_APP_TENANT_ID }}
50+ subscription-id : ${{ secrets.AZURE_APP_SUBSCRIPTION_ID }}
51+
4552 - name : Setup Terraform
4653 uses : hashicorp/setup-terraform@v3
4754 with :
5057
5158 - name : Initialise Terraform
5259 id : init
60+ env :
61+ AZURE_APP_SUBSCRIPTION_ID : ${{ secrets.AZURE_APP_SUBSCRIPTION_ID }}
5362 run : |
5463 echo "" >> build/terraform.tfvars.aws
5564 echo "jfrog_credential_provider_binary_url=\"$JFROG_CREDENTIAL_PLUGIN_BINARY_URL\"" >> build/terraform.tfvars.aws
65+ # for azure, it is not possible to avoid azure authentication check, even when azure is disabled
66+ echo "azure_subscription_id=\"$AZURE_APP_SUBSCRIPTION_ID\"" >> build/terraform.tfvars.aws
5667 cp build/terraform.tfvars.aws terraform-ci/terraform.tfvars
5768 cd terraform-ci
5869 terraform init
7889 if : always()
7990 uses : actions/upload-artifact@v4
8091 with :
81- name : terraform-context-for-manual-cleanup
92+ name : terraform-context-for-manual-cleanup-aws
8293 path : |
8394 terraform-ci/**/*.tf
8495 terraform-ci/jfrog/*
@@ -97,8 +108,11 @@ jobs:
97108 steps :
98109 - name : Checkout
99110 uses : actions/checkout@v2
111+
112+ - name : Install Azure CLI
113+ uses : pietrobolcato/install-azure-cli-action@main
100114
101- - name : ' Login to Azure with Federated Credentials'
115+ - name : Login to Azure with Federated Credentials
102116 uses : azure/login@v1
103117 with :
104118 client-id : ${{ secrets.AZURE_APP_CLIENT_ID }}
@@ -113,17 +127,22 @@ jobs:
113127
114128 - name : Initialise Terraform
115129 id : init
130+ env :
131+ AZURE_APP_SUBSCRIPTION_ID : ${{ secrets.AZURE_APP_SUBSCRIPTION_ID }}
116132 run : |
117133 echo "" >> build/terraform.tfvars.azure
118134 echo "jfrog_credential_provider_binary_url=\"$JFROG_CREDENTIAL_PLUGIN_BINARY_URL\"" >> build/terraform.tfvars.azure
135+ echo "azure_subscription_id=\"$AZURE_APP_SUBSCRIPTION_ID\"" >> build/terraform.tfvars.azure
119136 cp build/terraform.tfvars.azure terraform-ci/terraform.tfvars
120137 cd terraform-ci
121138 terraform init
122139
123140 - name : Run Azure Terraform CI
124141 id : apply
125142 run : |
143+ # to avoid credentials check for aws
126144 cd terraform-ci
145+ cat terraform.tfvars
127146 terraform apply -input=false -auto-approve
128147 terraform output -json > terraform_output.json
129148 echo "Terraform output: $(cat terraform_output.json)"
@@ -141,7 +160,7 @@ jobs:
141160 if : always()
142161 uses : actions/upload-artifact@v4
143162 with :
144- name : terraform-context-for-manual-cleanup
163+ name : terraform-context-for-manual-cleanup-azure
145164 path : |
146165 terraform-ci/**/*.tf
147166 terraform-ci/jfrog/*
0 commit comments