1515permissions :
1616 contents : read
1717 actions : read
18+ id-token : write
1819
1920env :
2021 GPT_MIN_CAPACITY : 150
2324jobs :
2425 deploy :
2526 runs-on : ubuntu-latest
27+ environment : production
2628 outputs :
2729 RESOURCE_GROUP_NAME : ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
2830 WEBAPP_URL : ${{ steps.get_output.outputs.WEBAPP_URL }}
@@ -33,14 +35,15 @@ jobs:
3335 uses : actions/checkout@v6
3436
3537 - name : Login to Azure
36- run : |
37- az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
38+ uses : azure/login@v2
39+ with :
40+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
41+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
42+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
43+
3844 - name : Run Quota Check
3945 id : quota-check
4046 env :
41- AZURE_CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
42- AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
43- AZURE_CLIENT_SECRET : ${{ secrets.AZURE_CLIENT_SECRET }}
4447 AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4548 GPT_MIN_CAPACITY : ${{ env.GPT_MIN_CAPACITY }}
4649 TEXT_EMBEDDING_MIN_CAPACITY : ${{ env.TEXT_EMBEDDING_MIN_CAPACITY }}
@@ -115,7 +118,7 @@ jobs:
115118 echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"
116119 - name : Determine Tag Name Based on Branch
117120 id : determine_tag
118- run : echo "tagname=${{ github.ref_name == 'main' && 'latest_waf ' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || 'latest_waf ' }}" >> $GITHUB_OUTPUT
121+ run : echo "tagname=${{ github.ref_name == 'main' && 'latest_afv2 ' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || 'latest_afv2 ' }}" >> $GITHUB_OUTPUT
119122 - name : Deploy Bicep Template
120123 id : deploy
121124 run : |
@@ -127,7 +130,7 @@ jobs:
127130 az deployment group create \
128131 --resource-group ${{ env.RESOURCE_GROUP_NAME }} \
129132 --template-file infra/main.bicep \
130- --parameters solutionName=${{env.SOLUTION_PREFIX}} location="${{ env.AZURE_LOCATION }}" contentUnderstandingLocation="swedencentral" secondaryLocation="${{ env.AZURE_LOCATION }}" gptDeploymentCapacity=150 aiServiceLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline" tags="{'Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
133+ --parameters solutionName=${{env.SOLUTION_PREFIX}} location="${{ env.AZURE_LOCATION }}" secondaryLocation="${{ env.AZURE_LOCATION }}" gptDeploymentCapacity=150 aiServiceLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline" tags="{'Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
131134
132135
133136
@@ -191,13 +194,17 @@ jobs:
191194 if : always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
192195 needs : [deploy, e2e-test]
193196 runs-on : ubuntu-latest
197+ environment : production
194198 env :
195199 RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
196200 steps :
197201 - name : Login to Azure
198- run : |
199- az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
200- az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
202+ uses : azure/login@v2
203+ with :
204+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
205+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
206+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
207+
201208 - name : Extract AI Services and Key Vault Names
202209 if : always()
203210 run : |
0 commit comments