-
Notifications
You must be signed in to change notification settings - Fork 402
Expand file tree
/
Copy pathdeploy-managed-identity-webapi.yml
More file actions
57 lines (48 loc) · 1.81 KB
/
deploy-managed-identity-webapi.yml
File metadata and controls
57 lines (48 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build and Deploy Managed Identity WebAPI
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/deploy-managed-identity-webapi.yml'
- 'src/client/Microsoft.Identity.Client/ManagedIdentity/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
working-directory: ./tests/devapps/Managed Identity apps/ManagedIdentityWebApi
run: dotnet restore
- name: Build
working-directory: ./tests/devapps/Managed Identity apps/ManagedIdentityWebApi
run: dotnet build --configuration Release --no-restore
- name: Publish
working-directory: ./tests/devapps/Managed Identity apps/ManagedIdentityWebApi
run: dotnet publish -c Release -o ${{github.workspace}}/publish
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'msalmsi'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{github.workspace}}/publish
- name: Test deployed endpoint - Get Token
run: |
echo "Testing token endpoint..."
RESPONSE=$(curl -s -X GET "https://msalmsi-buaxcubfa5a9drf9.westus3-01.azurewebsites.net/AppService?resourceuri=https://vault.azure.net")
echo "Response: $RESPONSE"
if echo "$RESPONSE" | grep -q "Access token received"; then
echo "✅ Successfully retrieved access token"
exit 0
else
echo "⚠️ Response received but may need review: $RESPONSE"
exit 0
fi