You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,10 @@ A Python script to sync Microsoft Intune managed devices into Snipe-IT, with the
31
31
cd intune-snipe-sync
32
32
```
33
33
2. Install dependencies:
34
+
```bash
35
+
pip install -r requirements.txt
36
+
```
37
+
Or install manually:
34
38
```bash
35
39
pip install msal requests
36
40
```
@@ -95,6 +99,54 @@ python3 app.py --platform windows --groups "<group-object-id-1>,<group-object-id
95
99
96
100
**Note:** Group filtering requires devices to be Azure AD registered/joined. Devices that are only Intune-managed without Azure AD registration will not be matched.
97
101
102
+
## Deployment
103
+
104
+
This project includes a `Dockerfile` and Kubernetes manifest (`k8s/cronjob.yaml`) that you can use to automate the sync process. **It's recommended to test the script directly using Python first**, and once you've verified it works correctly, deploy it using Docker or Kubernetes.
105
+
106
+
### Docker
107
+
108
+
Build and run the Docker container:
109
+
110
+
```bash
111
+
# Build the image
112
+
docker build -t intune2snipe:latest .
113
+
114
+
# Run the container
115
+
docker run --rm \
116
+
-e AZURE_TENANT_ID="<your-tenant-id>" \
117
+
-e AZURE_CLIENT_ID="<your-client-id>" \
118
+
-e AZURE_CLIENT_SECRET="<your-client-secret>" \
119
+
-e SNIPEIT_URL="<your-snipeit-url>" \
120
+
-e SNIPEIT_API_TOKEN="<your-token>" \
121
+
intune2snipe:latest \
122
+
--platform windows --dry-run
123
+
```
124
+
125
+
### Kubernetes
126
+
127
+
The Kubernetes manifest includes a CronJob that runs the sync on a schedule (default: daily at 2:00 AM UTC).
128
+
129
+
1.**Edit the Kubernetes manifest** (`k8s/cronjob.yaml`):
130
+
- Update the Secret values with your actual credentials
131
+
- Update the image name to match your container registry
132
+
- Customize the schedule if needed (cron format)
133
+
- Adjust resource limits if necessary
134
+
135
+
2.**Apply the manifest**:
136
+
```bash
137
+
kubectl apply -f k8s/cronjob.yaml
138
+
```
139
+
140
+
3.**Check the CronJob status**:
141
+
```bash
142
+
kubectl get cronjob intune2snipe-sync
143
+
kubectl get jobs -l app=intune2snipe-sync
144
+
```
145
+
146
+
### GitHub Actions
147
+
148
+
The repository includes a GitHub Actions workflow (`.github/workflows/docker-build.yml`) that automatically builds and pushes Docker images to GitHub Container Registry (ghcr.io) on push to main/master branches. Update the image name in the Kubernetes manifest to match your repository path.
149
+
98
150
## How it works
99
151
100
152
1.**Fetch** Azure AD device IDs from specified groups (if `--groups` or `AZURE_GROUP_IDS` is set).
0 commit comments