1+ name : Deploy Content to logworkspace [3deaee03-d682-43b3-aa17-4df53dc98264]
2+ # Note: This workflow will deploy everything in the root directory.
3+ # To deploy content only from a specific path (for example SentinelContent):
4+ # 1. Add the target path to the "paths" property like such
5+ # paths:
6+ # - 'SentinelContent/**'
7+ # - '!.github/workflows/**'
8+ # - '.github/workflows/sentinel-deploy-3deaee03-d682-43b3-aa17-4df53dc98264.yml'
9+ # 2. Append the path to the directory environment variable below
10+ # directory: '${{ github.workspace }}/SentinelContent'
11+
12+ on :
13+ push :
14+ branches : [ BugFix ]
15+ paths :
16+ - ' **'
17+ - ' !.github/workflows/**' # this filter prevents other workflow changes from triggering this workflow
18+ - ' .github/workflows/sentinel-deploy-3deaee03-d682-43b3-aa17-4df53dc98264.yml'
19+
20+ jobs :
21+ deploy-content :
22+ runs-on : windows-latest
23+ env :
24+ resourceGroupName : ' sentineldemo'
25+ workspaceName : ' logworkspace'
26+ workspaceId : ' 6202d0f0-3e8c-44a1-bc49-6f37e1b7fc99'
27+ directory : ' ${{ github.workspace }}'
28+ cloudEnv : ' AzureCloud'
29+ creds : ${{ secrets.AZURE_SENTINEL_CREDENTIALS_3deaee03d68243b3aa174df53dc98264 }}
30+ contentTypes : ' AnalyticsRule,AutomationRule,HuntingQuery,Parser,Playbook,Workbook'
31+ branch : ' BugFix'
32+ sourceControlId : ' 3deaee03-d682-43b3-aa17-4df53dc98264'
33+ rootDirectory : ' ${{ github.workspace }}'
34+ githubAuthToken : ${{ secrets.GITHUB_TOKEN }}
35+ smartDeployment : ' true'
36+ permissions :
37+ contents : write
38+
39+ steps :
40+ - name : Login to Azure (Attempt 1)
41+ continue-on-error : true
42+ id : login1
43+ uses : azure/login@v2
44+ if : ${{ env.cloudEnv == 'AzureCloud' }}
45+ with :
46+ creds : ${{ secrets.AZURE_SENTINEL_CREDENTIALS_3deaee03d68243b3aa174df53dc98264 }}
47+ enable-AzPSSession : true
48+
49+ - name : Wait 30 seconds if login attempt 1 failed
50+ if : ${{ env.cloudEnv == 'AzureCloud' && steps.login1.outcome=='failure' }}
51+ run : powershell Start-Sleep -s 30
52+
53+ - name : Login to Azure (Attempt 2)
54+ continue-on-error : true
55+ id : login2
56+ uses : azure/login@v2
57+ if : ${{ env.cloudEnv == 'AzureCloud' && steps.login1.outcome=='failure' }}
58+ with :
59+ creds : ${{ secrets.AZURE_SENTINEL_CREDENTIALS_3deaee03d68243b3aa174df53dc98264 }}
60+ enable-AzPSSession : true
61+
62+ - name : Wait 30 seconds if login attempt 2 failed
63+ if : ${{ env.cloudEnv == 'AzureCloud' && steps.login2.outcome=='failure' }}
64+ run : powershell Start-Sleep -s 30
65+
66+ - name : Login to Azure (Attempt 3)
67+ continue-on-error : false
68+ id : login3
69+ uses : azure/login@v2
70+ if : ${{ env.cloudEnv == 'AzureCloud' && steps.login2.outcome=='failure' }}
71+ with :
72+ creds : ${{ secrets.AZURE_SENTINEL_CREDENTIALS_3deaee03d68243b3aa174df53dc98264 }}
73+ enable-AzPSSession : true
74+
75+ - name : Checkout
76+ uses : actions/checkout@v3
77+
78+ - name : Deploy Content to Microsoft Sentinel
79+ uses : azure/powershell@v1
80+ with :
81+ azPSVersion : ' latest'
82+ inlineScript : |
83+ ${{ github.workspace }}//.github/workflows/azure-sentinel-deploy-3deaee03-d682-43b3-aa17-4df53dc98264.ps1
0 commit comments