1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { MicrosoftGraph } from '@microsoft/microsoft-graph-client';
import { AzureFunction, Context } from '@azure/functions';
const initializeM365 = async (tenantId: string) => {
const client = MicrosoftGraph.init({
authProvider: async (done) => {
const token = await getAccessToken(tenantId);
done(null, token);
}
});
await client.api('/sites').get();
return { status: 'connected', timestamp: new Date() };
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
"tenant": {
"id": "your-tenant-id",
"domain": "okada-works.onmicrosoft.com",
"region": "japaneast"
},
"applications": {
"sharepoint": {
"enabled": true,
"siteCollections": 5,
"storageQuotaGB": 1024
},
"teams": {
"enabled": true,
"policies": ["external-access", "guest-access"]
},
"exchange": {
"enabled": true,
"mailboxSizeGB": 50,
"retentionDays": 365
}
},
"security": {
"mfa": true,
"conditionalAccess": true
}
}
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
name: Azure Cloud Migration Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: okada-cloud-app
package: .
- name: Run Migration Scripts
run: |
az storage account create --name okadabackup
az sql db copy --dest-name production-db