@@ -170,17 +170,23 @@ jobs:
170170 if : steps.prereqs.outputs.configured == 'true' && vars.SHARING_CUSTOM_DOMAIN != ''
171171 working-directory : sharing-server/infra
172172 env :
173- TF_VAR_resource_group_name : ${{ vars.AZURE_RESOURCE_GROUP }}
174- TF_VAR_app_name : ${{ needs.setup.outputs.app_name }}
175- TF_VAR_custom_domain : ${{ vars.SHARING_CUSTOM_DOMAIN }}
173+ TF_VAR_resource_group_name : ${{ vars.AZURE_RESOURCE_GROUP }}
174+ TF_VAR_location : ${{ vars.AZURE_LOCATION || 'westeurope' }}
175+ TF_VAR_app_name : ${{ needs.setup.outputs.app_name }}
176+ TF_VAR_container_image : ${{ needs.build.outputs.image }}
177+ TF_VAR_github_client_id : ${{ secrets.SHARING_GITHUB_CLIENT_ID }}
178+ TF_VAR_github_client_secret : ${{ secrets.SHARING_GITHUB_CLIENT_SECRET }}
179+ TF_VAR_session_secret : ${{ secrets.SHARING_SESSION_SECRET }}
180+ TF_VAR_allowed_github_org : ${{ vars.SHARING_ALLOWED_GITHUB_ORG }}
181+ TF_VAR_github_org_check_token : ${{ secrets.ORG_CHECK_TOKEN }}
182+ TF_VAR_min_replicas : ${{ needs.setup.outputs.min_replicas }}
183+ TF_VAR_custom_domain : ${{ vars.SHARING_CUSTOM_DOMAIN }}
176184 run : |
177- # Authenticate az CLI with the same service principal used by Terraform.
178185 az login --service-principal -u "$ARM_CLIENT_ID" -p "$ARM_CLIENT_SECRET" --tenant "$ARM_TENANT_ID" --output none
179186 az account set --subscription "$ARM_SUBSCRIPTION_ID"
180187
181188 ENV_NAME="${TF_VAR_app_name}-env"
182189
183- # Import managed certificate if it already exists in Azure but not in state.
184190 if ! terraform state show 'azurerm_container_app_environment_managed_certificate.this[0]' > /dev/null 2>&1; then
185191 CERT_ID=$(az containerapp env certificate list \
186192 --name "$ENV_NAME" \
@@ -189,16 +195,15 @@ jobs:
189195 -o tsv 2>/dev/null || true)
190196 if [[ -n "$CERT_ID" && "$CERT_ID" != "None" ]]; then
191197 echo "Importing managed certificate: $CERT_ID"
192- terraform import 'azurerm_container_app_environment_managed_certificate.this[0]' "$CERT_ID"
198+ terraform import -input=false 'azurerm_container_app_environment_managed_certificate.this[0]' "$CERT_ID"
193199 fi
194200 fi
195201
196- # Import custom domain binding if it already exists in Azure but not in state.
197202 if ! terraform state show 'azurerm_container_app_custom_domain.this[0]' > /dev/null 2>&1; then
198203 DOMAIN_ID="/subscriptions/$ARM_SUBSCRIPTION_ID/resourceGroups/$TF_VAR_resource_group_name/providers/Microsoft.App/containerApps/$TF_VAR_app_name/customDomainName/$TF_VAR_custom_domain"
199204 if az rest --method get --url "https://management.azure.com${DOMAIN_ID}?api-version=2024-03-01" > /dev/null 2>&1; then
200205 echo "Importing custom domain: $DOMAIN_ID"
201- terraform import 'azurerm_container_app_custom_domain.this[0]' "$DOMAIN_ID"
206+ terraform import -input=false 'azurerm_container_app_custom_domain.this[0]' "$DOMAIN_ID"
202207 fi
203208 fi
204209
0 commit comments