Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
passing name instead of resource ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Physer committed Dec 17, 2024
1 parent 80fca88 commit c1e8dda
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
resourceLocation: ${{ steps.deployinfra.outputs.resourceLocation }}
logAnalyticsWorkspaceName: ${{ steps.deployinfra.outputs.logAnalyticsWorkspaceName }}
keyVaultName: ${{ steps.deployinfra.outputs.keyVaultName }}
identityResourceId: ${{ steps.deployinfra.outputs.identityResourceId }}
identityName: ${{ steps.deployinfra.outputs.identityName }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
logAnalyticsWorkspaceName=${{ needs.deploy_infra.outputs.logAnalyticsWorkspaceName }}
keyVaultName=${{ needs.deploy_infra.outputs.keyVaultName }}
registryName=${{ needs.deploy_infra.outputs.containerRegistryName }}
identityResourceId=${{ needs.deploy_infra.outputs.identityResourceId }}
identityName=${{ needs.deploy_infra.outputs.identityName }}
cmsImageName=${{ needs.deploy_infra.outputs.containerRegistryLoginServer }}/cms:latest
cmsInitImageName=${{ needs.deploy_infra.outputs.containerRegistryLoginServer }}/cms/init:latest
region: ${{ vars.AZURE_REGION }}
2 changes: 1 addition & 1 deletion infrastructure/cms/infrastructure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ output containerRegistryName string = containerRegistry.outputs.registryName
output containerRegistryLoginServer string = containerRegistry.outputs.registryLoginServer
output logAnalyticsWorkspaceName string = logAnalyticsWorkspace.outputs.resourceName
output keyVaultName string = keyVault.outputs.resourceName
output identityResourceId string = cmsIdentity.outputs.resourceId
output identityName string = cmsIdentity.outputs.name
8 changes: 6 additions & 2 deletions infrastructure/cms/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ param databaseClient string
param logAnalyticsWorkspaceName string
param keyVaultName string
param registryName string
param identityResourceId string
param identityName string
param cmsImageName string
param cmsInitImageName string = ''

Expand All @@ -20,6 +20,10 @@ resource registry 'Microsoft.ContainerRegistry/registries@2023-07-01' existing =
name: registryName
}

resource cmsIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = {
name: identityName
}

module mySql '../modules/sql.bicep' = {
name: 'deployMysql'
params: {
Expand All @@ -36,7 +40,7 @@ module cmsContainerApp '../modules/containerApp.bicep' = {
initImageName: cmsInitImageName
logAnalyicsWorkspaceName: logAnalyticsWorkspaceName
targetPort: 1337
cmsIdentityResourceId: identityResourceId
cmsIdentityResourceId: cmsIdentity.id
keyVaultUri: keyVault.properties.vaultUri
registryLoginServer: registry.properties.loginServer
environmentVariables: [
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/identity.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ resource cmsIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-3
location: resourceGroup().location
}

output resourceId string = cmsIdentity.id
output name string = cmsIdentity.name
output principalId string = cmsIdentity.properties.principalId

0 comments on commit c1e8dda

Please sign in to comment.