forked from Azure/azure-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Use ODIC and TME for
test-templates
(Azure#4522)
This change reworks the `test-templates` test legs to use OIDC and move to our TME subscription. To do so, we capture the relevent `AZURESUBSCRIPTION_` environment variables that are set by the AzureCLI task and then flow them into the dev container when we run tests. This allows us to do `azd auth login` inside the devcontainer but still use OIDC so we don't have a long lived secret. The call to `az login` was removed because we don't yet have a way to have this work well with ODIC in the container. This means the terraform flavor of the tests won't work (since auth is broken) but these legs have been broken in both the bicep and terraform flavors for a while, so this moves us in a better direction (and gets us off of client secrets and onto TME for these tests). Contributes To Azure#4341
- Loading branch information
Showing
2 changed files
with
30 additions
and
45 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
parameters: | ||
ServiceConnectionName: "azd-service-connection" | ||
|
||
steps: | ||
- task: AzureCLI@2 | ||
condition: and(succeeded(), ne(variables['Skip.LiveTest'], 'true')) | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnectionName }} | ||
scriptType: pscore | ||
scriptLocation: inlineScript | ||
inlineScript: | | ||
Write-Host "##vso[task.setvariable variable=AzureSubscriptionClientId;issecret=false]$($env:AZURESUBSCRIPTION_CLIENT_ID)" | ||
Write-Host "##vso[task.setvariable variable=AzureSubscriptionTenantId;issecret=false]$($env:AZURESUBSCRIPTION_TENANT_ID)" | ||
Write-Host "##vso[task.setvariable variable=AzureSubscriptionServiceConnectionId;issecret=false]$($env:AZURESUBSCRIPTION_SERVICE_CONNECTION_ID)" | ||
Write-Host "##vso[task.setvariable variable=SubscriptionId;issecret=false]$((az account show -o json | ConvertFrom-Json -AsHashtable)['id'])" | ||
displayName: Configure OIDC Authentication |
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