Skip to content

Commit

Permalink
Separate SC & WIF Scs to test
Browse files Browse the repository at this point in the history
  • Loading branch information
geekzter committed Jun 7, 2024
1 parent a5c35f8 commit 1a75aa2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
24 changes: 12 additions & 12 deletions scripts/azure-devops/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- task: AzureCLI@2
displayName: 'rename_service_connection_applications.ps1'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand All @@ -86,7 +86,7 @@ jobs:
- task: AzureCLI@2
displayName: 'list_service_connections.ps1'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand All @@ -101,7 +101,7 @@ jobs:
- task: AzureCLI@2
displayName: 'list_service_connection_identities.ps1'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand All @@ -116,7 +116,7 @@ jobs:
- task: AzureCLI@2
displayName: 'list_identities_using_issuer.ps1'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand All @@ -132,7 +132,7 @@ jobs:
displayName: 'set_terraform_azurerm_vars.ps1'
inputs:
addSpnToEnvironment: true
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: ./set_terraform_azurerm_vars.ps1
Expand All @@ -151,7 +151,7 @@ jobs:
displayName: 'Create resource groups for Managed Identity and scope'
name: resourceGroup
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
failOnStandardError: true
scriptType: pscore
scriptLocation: inlineScript
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
displayName: 'Create Managed Identity and Service Connection'
name: identity
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
failOnStandardError: true
scriptType: pscore
scriptLocation: inlineScript
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
displayName: 'Test Service Connection $(serviceConnectionToCreate)'
timeoutInMinutes: 5
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
failOnStandardError: true
scriptType: pscore
scriptLocation: inlineScript
Expand All @@ -249,7 +249,7 @@ jobs:
- task: AzureCLI@2
displayName: 'Convert (WhatIf)'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionSecret)'
failOnStandardError: true
scriptType: pscore
scriptLocation: inlineScript
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
- task: AzureCLI@2
displayName: 'Convert simple (WhatIf)'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionSecret)'
failOnStandardError: true
scriptType: pscore
scriptLocation: inlineScript
Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
name: teardownAzure
displayName: 'Tear down Azure resources'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
name: teardownAzDO
condition: succeededOrFailed()
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand Down
18 changes: 9 additions & 9 deletions scripts/azure-devops/create-oidctoken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
displayName: 'Scripted with addSpnToEnvironment'
inputs:
addSpnToEnvironment: true
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Write-Host "Using Service Connection $(azureConnection)"
az account show -o json >"$(azureConnection).json"
Write-Host "Using Service Connection $(azureConnectionWIF)"
az account show -o json >"$(azureConnectionWIF).json"
$(scriptDirectory)/set_terraform_azurerm_vars.ps1
Write-Host "##vso[task.setvariable variable=ARM_CLIENT_ID;isoutput=true]${env:ARM_CLIENT_ID}"
Expand All @@ -56,7 +56,7 @@ jobs:
Write-Host "##vso[task.setvariable variable=ARM_USE_OIDC;isoutput=true]${env:ARM_USE_OIDC}"
if ($env:ARM_USE_OIDC -ine 'true') {
Write-Host "##vso[task.logissue type=warning]Skipping OIDC test because service connection '$(azureConnection)' is not using federation"
Write-Host "##vso[task.logissue type=warning]Skipping OIDC test because service connection '$(azureConnectionWIF)' is not using federation"
}
failOnStandardError: true
workingDirectory: $(Build.ArtifactStagingDirectory)
Expand All @@ -81,11 +81,11 @@ jobs:
displayName: 'Scripted with REST API'
inputs:
addSpnToEnvironment: true
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Write-Host "Using Service Connection $(azureConnection)"
Write-Host "Using Service Connection $(azureConnectionWIF)"
$(scriptDirectory)/set_terraform_azurerm_vars.ps1 -RequestNewToken -SystemAccessToken $(System.AccessToken)
Write-Host "##vso[task.setvariable variable=ARM_CLIENT_ID;isoutput=true]${env:ARM_CLIENT_ID}"
Expand All @@ -97,7 +97,7 @@ jobs:
Write-Host "##vso[task.setvariable variable=ARM_USE_OIDC;isoutput=true]${env:ARM_USE_OIDC}"
if ($env:ARM_USE_OIDC -ine 'true') {
Write-Host "##vso[task.logissue type=warning]Skipping OIDC test because service connection '$(azureConnection)' is not using federation"
Write-Host "##vso[task.logissue type=warning]Skipping OIDC test because service connection '$(azureConnectionWIF)' is not using federation"
}
failOnStandardError: true
workingDirectory: $(Build.ArtifactStagingDirectory)
Expand All @@ -120,7 +120,7 @@ jobs:
- task: AzureCLI@2
displayName: 'Inline script'
inputs:
azureSubscription: '$(azureConnection)'
azureSubscription: '$(azureConnectionWIF)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Expand Down Expand Up @@ -160,4 +160,4 @@ jobs:

- publish: $(Build.ArtifactStagingDirectory)
displayName: 'Publish json files'
artifact: $(azureConnection)
artifact: $(azureConnectionWIF)

0 comments on commit 1a75aa2

Please sign in to comment.