Switched to Service Principal credentials

This commit is contained in:
Matthew Garrett 2023-08-20 09:19:10 -07:00
Родитель 044407599f
Коммит 472a60b568
1 изменённых файлов: 35 добавлений и 33 удалений

40
.github/workflows/azure-ipam-testing.yml поставляемый
Просмотреть файл

@ -1,8 +1,8 @@
name: Azure IPAM Testing
permissions:
id-token: write
contents: read
# permissions:
# id-token: write
# contents: read
run-name: Azure IPAM Deployment & Testing
@ -23,30 +23,33 @@ jobs:
- run: echo "Job triggered by a ${{ github.event_name }} event from ${{ github.head_ref }} to main."
- name: Install Deployment Prerequisites
uses: azure/powershell@v1
with:
inlineScript: |
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Az, Microsoft.Graph -Force
azPSVersion: "latest"
# - name: "Azure Login"
# uses: azure/login@v1
# with:
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
# subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
# enable-AzPSSession: true
- name: "Azure Login"
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true
- name: Checkout Azure IPAM Code
uses: actions/checkout@v3
- name: Deploy Azure IPAM
uses: azure/powershell@v1
working-directory: "deploy"
id: "pwshScript"
with:
inlineScript: ./deploy/deploy.ps1 -Location "westus3" -UIAppName $Env:IPAM_UI_ID -EngineAppName $Env:IPAM_ENGINE_ID
azPSVersion: "latest"
shell: pwsh
run: ./deploy.ps1 -Location "westus3" -UIAppName $Env:IPAM_UI_ID -EngineAppName $Env:IPAM_ENGINE_ID
- name: "Output PowerShell Value 'ipamSuffix'"
run: echo "${{ steps.pwshScript.outputs.ipamSuffix }}"
@ -59,12 +62,12 @@ jobs:
echo "Time: $(date +'%T')"
- name: "Upload Logs"
uses: azure/powershell@v1
with:
inlineScript: |
working-directory: "logs"
shell: pwsh
run: |
$dateStamp = (Get-Date -UFormat "%Y-%m-%d_%I-%M-%S_%p").tostring()
$archiveName = "ipam-${dateStamp}.zip"
Compress-Archive -Path ./logs/* -DestinationPath /tmp/$archiveName
Compress-Archive -Pat ./* -DestinationPath /tmp/$archiveName
$storage = Get-AzStorageAccount -Name "ipamghactionlogs" -ResourceGroupName "Logging-RG"
$context = $storage.Context
$uploadDetails = @{
@ -75,6 +78,5 @@ jobs:
StandardBlobTier = "Hot"
}
Set-AzStorageBlobContent @uploadDetails
azPSVersion: "latest"
- run: echo "${{ github.job }} status is ${{ job.status }}."