Skip to content

Commit eb6490f

Browse files
author
Alex Jordache
committed
Update React Sample to work without secrets/CCA
1 parent 039e64f commit eb6490f

29 files changed

Lines changed: 391 additions & 343 deletions

.claude/settings.local.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(npm run build:*)",
5+
"Bash(npx tsc:*)"
6+
]
7+
}
8+
}

Bruno/template.bruno_environment.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
"type": "default",
99
"enabled": true
1010
},
11-
{
12-
"key": "ClientSecret",
13-
"value": "",
14-
"type": "secret",
15-
"enabled": true
16-
},
1711
{
1812
"key": "ConsumingTenantId",
1913
"value": "",
@@ -37,18 +31,6 @@
3731
"value": "",
3832
"type": "default",
3933
"enabled": true
40-
},
41-
{
42-
"key": "CertThumbprint",
43-
"value": "",
44-
"type": "default",
45-
"enabled": true
46-
},
47-
{
48-
"key": "CertPrivateKey",
49-
"value": "",
50-
"type": "secret",
51-
"enabled": true
5234
}
5335
],
5436
"_postman_variable_scope": "environment",

Postman/template.postman_environment.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
"type": "default",
99
"enabled": true
1010
},
11-
{
12-
"key": "ClientSecret",
13-
"value": "",
14-
"type": "secret",
15-
"enabled": true
16-
},
1711
{
1812
"key": "ConsumingTenantId",
1913
"value": "",
@@ -43,12 +37,6 @@
4337
"value": "",
4438
"type": "default",
4539
"enabled": true
46-
},
47-
{
48-
"key": "CertPrivateKey",
49-
"value": "",
50-
"type": "secret",
51-
"enabled": true
5240
}
5341
],
5442
"_postman_variable_scope": "environment",

Samples/asp.net-webservice/appsettings.baseline.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
2-
"Instructions": "Use this file as a template for your application and save it with the name appsetings.json. Write the appropriate values for ClientId, ClientSecret or ClientCertificate (use just one) and ContainerTypeId",
2+
"Instructions": "Use this file as a template for your application and save it with the name appsettings.json. Write the appropriate values for ClientId and ContainerTypeId. No client secret is needed — the app uses public client (PKCE) auth.",
33
"AzureAd": {
44
"Instance": "https://login.microsoftonline.com/",
55
"prompt": "select_account",
66
"TenantId": "common",
77
"ClientId": "[appId]",
88
"CallbackPath": "/signin-oidc",
9-
"SignedOutCallbackPath ": "/signout-callback-oidc",
10-
"ClientSecret": "[client secret]"
9+
"SignedOutCallbackPath ": "/signout-callback-oidc"
1110
},
1211

1312
"GraphAPI": {

Samples/asp.net-webservice/appsettings.docker.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
{
2-
"Instructions": "Use this file as a template for your application and save it with the name appsetings.json. Write the appropriate values for ClientId, ClientSecret or ClientCertificate (use just one) and ContainerTypeId",
2+
"Instructions": "Use this file as a template for your application and save it with the name appsettings.json. Write the appropriate values for ClientId and ContainerTypeId. No client secret is needed — the app uses public client (PKCE) auth.",
33
"AzureAd": {
44
"Instance": "https://login.microsoftonline.com/",
55
"prompt": "select_account",
66
"TenantId": "common",
77
"ClientId": "[appId]",
88
"CallbackPath": "/signin-oidc",
9-
"SignedOutCallbackPath ": "/signout-callback-oidc",
10-
"ClientSecret": "[client secret]",
11-
"_ClientCertificates": [
12-
{
13-
"SourceType": "Path",
14-
"CertificateDiskPath": "[path to combined cert pfx]"
15-
}
16-
]
9+
"SignedOutCallbackPath ": "/signout-callback-oidc"
1710
},
1811

1912
"GraphAPI": {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"ms-azuretools.vscode-azurefunctions"
4+
]
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Node Functions",
6+
"type": "node",
7+
"request": "attach",
8+
"restart": true,
9+
"port": 9229,
10+
"preLaunchTask": "func: host start"
11+
}
12+
]
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"azureFunctions.deploySubpath": "function-api",
3+
"azureFunctions.postDeployTask": "npm install (functions)",
4+
"azureFunctions.projectLanguage": "TypeScript",
5+
"azureFunctions.projectRuntime": "~4",
6+
"debug.internalConsoleOptions": "neverOpen",
7+
"azureFunctions.projectLanguageModel": 4,
8+
"azureFunctions.preDeployTask": "npm prune (functions)"
9+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "func",
6+
"label": "func: host start",
7+
"command": "host start",
8+
"problemMatcher": "$func-node-watch",
9+
"isBackground": true,
10+
"dependsOn": "npm watch (functions)",
11+
"options": {
12+
"cwd": "${workspaceFolder}/function-api"
13+
}
14+
},
15+
{
16+
"type": "shell",
17+
"label": "npm build (functions)",
18+
"command": "npm run build",
19+
"dependsOn": "npm clean (functions)",
20+
"problemMatcher": "$tsc",
21+
"options": {
22+
"cwd": "${workspaceFolder}/function-api"
23+
}
24+
},
25+
{
26+
"type": "shell",
27+
"label": "npm watch (functions)",
28+
"command": "npm run watch",
29+
"dependsOn": "npm clean (functions)",
30+
"problemMatcher": "$tsc-watch",
31+
"group": {
32+
"kind": "build",
33+
"isDefault": true
34+
},
35+
"isBackground": true,
36+
"options": {
37+
"cwd": "${workspaceFolder}/function-api"
38+
}
39+
},
40+
{
41+
"type": "shell",
42+
"label": "npm install (functions)",
43+
"command": "npm install",
44+
"options": {
45+
"cwd": "${workspaceFolder}/function-api"
46+
}
47+
},
48+
{
49+
"type": "shell",
50+
"label": "npm prune (functions)",
51+
"command": "npm prune --production",
52+
"dependsOn": "npm build (functions)",
53+
"problemMatcher": [],
54+
"options": {
55+
"cwd": "${workspaceFolder}/function-api"
56+
}
57+
},
58+
{
59+
"type": "shell",
60+
"label": "npm clean (functions)",
61+
"command": "npm run clean",
62+
"dependsOn": "npm install (functions)",
63+
"options": {
64+
"cwd": "${workspaceFolder}/function-api"
65+
}
66+
}
67+
]
68+
}

Samples/spe-typescript-react-azurefunction/function-api/local.settings.template.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"FUNCTIONS_WORKER_RUNTIME": "node",
66
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
77

8-
"AZURE_SPA_CLIENT_ID": "{{clientId}}",
98
"AZURE_CLIENT_ID": "{{clientId}}",
109
"SPE_CONTAINER_TYPE_ID": "{{containerTypeId}}",
1110

12-
"AZURE_CLIENT_SECRET": "{{clientSecret}}",
13-
"AZURE_AI_ENDPOINT": "{{Azure AI Doc Intelligence Endpoint -- this is optional, only used if you enable receipt processing}}",
14-
"AZURE_AI_API_KEY": "{{Azure AI Doc Intelligence API Key -- this is optional, only used if you enable receipt processing}}"
11+
"AZURE_CLIENT_SECRET": "{{optional -- enables CCA/OBO mode for non-admin users}}",
12+
"AZURE_SPA_CLIENT_ID": "{{optional -- set if using a separate SPA app registration in CCA mode}}",
13+
14+
"AZURE_AI_ENDPOINT": "{{optional -- Azure AI Doc Intelligence Endpoint, only for receipt processing}}",
15+
"AZURE_AI_API_KEY": "{{optional -- Azure AI Doc Intelligence API Key, only for receipt processing}}"
1516
},
1617
"Host": {
1718
"LocalHttpPort": 7072,

0 commit comments

Comments
 (0)