-
Notifications
You must be signed in to change notification settings - Fork 184
fix(develop): 17 corrections + orphan fix for PR #1636 #2026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ IF recipes detected: | |
| name: name | ||
| location: location | ||
| tags: tags | ||
| containerAppPrincipalId: app.outputs.principalId | ||
| principalId: app.outputs.principalId | ||
| } | ||
| } | ||
| ``` | ||
|
|
@@ -78,16 +78,13 @@ Read the recipe's `README.md` for required env vars. Add them to the container a | |
| Each recipe defines required RBAC roles. Use exact role definition GUIDs from recipe docs. | ||
|
|
||
| ```bicep | ||
| resource cosmosRbac 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
| name: guid(cosmos.id, uami.id, cosmosDataContributor) | ||
| scope: cosmos | ||
| resource cosmosRbac 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2024-05-15' = { | ||
| parent: cosmos | ||
| name: guid(cosmos.id, uami.id, 'data-contributor') | ||
| properties: { | ||
| roleDefinitionId: subscriptionResourceId( | ||
| 'Microsoft.Authorization/roleDefinitions', | ||
| '00000000-0000-0000-0000-000000000002' // from recipe | ||
| ) | ||
| roleDefinitionId: '${cosmos.id}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002' | ||
| principalId: uami.outputs.principalId | ||
| principalType: 'ServicePrincipal' | ||
| scope: cosmos.id | ||
|
Comment on lines
+81
to
+87
|
||
| } | ||
| } | ||
| ``` | ||
|
|
@@ -132,7 +129,7 @@ Base (web-app) | |
| ## Critical Rules | ||
|
|
||
| 1. **Never synthesize IaC from scratch** — always extend base template | ||
| 2. **Never modify base IaC files** — only ADD recipe modules alongside them | ||
| 2. **Don't replace or remove base IaC resources** — extend base files only by adding module references and additive resources | ||
| 3. **Always use recipe RBAC role GUIDs** — never let the LLM guess role IDs | ||
| 4. **Always use UAMI** — never use connection strings or access keys | ||
| 5. **Always use `--no-prompt`** with azd commands | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,14 +35,14 @@ resource redis 'Microsoft.Cache/redis@2024-03-01' = { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| // RBAC — Redis Cache Contributor | ||||||
| // RBAC — Redis Cache Data Owner | ||||||
| resource rbac 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||||||
| name: guid(redis.id, principalId, 'e0f68234-74aa-48ed-b826-c38b57376e17') | ||||||
| name: guid(redis.id, principalId, 'e12a10f1-dcd0-4ee7-abb0-0b2e24e345e7') | ||||||
| scope: redis | ||||||
| properties: { | ||||||
| roleDefinitionId: subscriptionResourceId( | ||||||
| 'Microsoft.Authorization/roleDefinitions', | ||||||
| 'e0f68234-74aa-48ed-b826-c38b57376e17' | ||||||
| 'e12a10f1-dcd0-4ee7-abb0-0b2e24e345e7' | ||||||
| ) | ||||||
| principalId: principalId | ||||||
| principalType: 'ServicePrincipal' | ||||||
|
|
@@ -67,8 +67,8 @@ env: [ | |||||
|
|
||||||
| | Role | GUID | Access | | ||||||
| |------|------|--------| | ||||||
| | Redis Cache Contributor | `e0f68234-74aa-48ed-b826-c38b57376e17` | Manage cache + data | | ||||||
| | Redis Cache Data Access | Custom role | Data plane operations | | ||||||
| | Redis Cache Data Owner | `e12a10f1-dcd0-4ee7-abb0-0b2e24e345e7` | Read + write data | | ||||||
| | Redis Cache Data Contributor | `e12a10f1-dcd0-4ee7-abb0-0b2e24e345c2` | Read-only data | | ||||||
|
||||||
| | Redis Cache Data Contributor | `e12a10f1-dcd0-4ee7-abb0-0b2e24e345c2` | Read-only data | | |
| | Redis Cache Data Contributor | `e12a10f1-dcd0-4ee7-abb0-0b2e24e345c2` | Read + write data | |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -46,6 +46,7 @@ param envId string | |||||||
| param containerRegistryName string | ||||||||
| param imageName string | ||||||||
| param userAssignedIdentityId string | ||||||||
| param uamiClientId string | ||||||||
| param serviceBusNamespace string = '' | ||||||||
| param queueName string = '' | ||||||||
|
|
||||||||
|
|
@@ -82,7 +83,7 @@ resource worker 'Microsoft.App/containerApps@2024-03-01' = { | |||||||
| { name: 'QUEUE_NAME', value: queueName } | ||||||||
| { | ||||||||
| name: 'AZURE_CLIENT_ID' | ||||||||
| value: '' // Set to UAMI client ID | ||||||||
| value: uamiClientId | ||||||||
| } | ||||||||
| ] | ||||||||
| } | ||||||||
|
|
@@ -100,12 +101,7 @@ resource worker 'Microsoft.App/containerApps@2024-03-01' = { | |||||||
| queueName: queueName | ||||||||
| messageCount: '5' | ||||||||
| } | ||||||||
|
||||||||
| } | |
| } | |
| // Required when the Service Bus scaler uses managed identity authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uamiClientIdis referenced forAzureWebJobsStorage__clientId, but this Bicep snippet doesn't declare auamiClientIdparameter (or otherwise define it). As written, the template won't compile; add aparam uamiClientId string(consistent with other templates) or derive the clientId from the UAMI resource ID being passed in.