-
Notifications
You must be signed in to change notification settings - Fork 18
[DevOps] Table Storage용 bicep 파일 만들기 #283 #292
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
Merged
justinyoo
merged 21 commits into
aliencube:main
from
tae0y:feature/283-table-storage-bicep
Sep 14, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f198d50
add : storage account 기본 bicep
tae0y 0d5b7a8
update : bicep에서 테이블 목록 정의
tae0y 7e38848
update : storage account 고유한 이름 부여
tae0y bb711e5
update : bicep 파일구조 변경, 불필요 변경 원복
tae0y 32d112a
update : bicep 각주추가
tae0y 4a9b9ca
update : table 생성 구문 수정
tae0y 9b0d1af
Merge branch 'aliencube:main' into feature/283-table-storage-bicep
tae0y 504e774
update : connectionstring을 keyvault에 저장
tae0y 9cdc78b
Merge branch 'feature/283-table-storage-bicep' of https://github.com/…
tae0y 24689c5
staging : checkout전 작업사항 정리
tae0y c1895ea
update : connection string을 정상적으로 참조
tae0y 8162793
update : 권한설정 placeholder 구문 추가
tae0y ac8426e
update : 권한설정 구문 임시 주석처리
tae0y ff4ef4b
update : storage-account.bicep 내부에서 connection string 저장
tae0y 03939f2
update : aspire.bicep으로 secret 저장위치 변경
tae0y e0f344a
Merge branch 'main' into feature/283-table-storage-bicep
tae0y 3721813
delete : 불필요 로컬파일 삭제
tae0y 172629c
update : storage-account.bicep 내부에서 연결문자열 처리
tae0y 1c3af3a
update : storage connection string 이름 변경
tae0y 9154974
Merge branch 'main' into feature/283-table-storage-bicep
tae0y ffc44c3
update : storage connection string 이름 변경
tae0y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
metadata description = 'Creates an Azure storage account.' | ||
param name string | ||
param location string = resourceGroup().location | ||
param tags object = {} | ||
|
||
@allowed([ | ||
'Cool' | ||
'Hot' | ||
'Premium' ]) | ||
param accessTier string = 'Hot' | ||
param allowBlobPublicAccess bool = true | ||
param allowCrossTenantReplication bool = true | ||
param allowSharedKeyAccess bool = true | ||
param containers array = [] | ||
param corsRules array = [] | ||
param defaultToOAuthAuthentication bool = false | ||
param deleteRetentionPolicy object = {} | ||
@allowed([ 'AzureDnsZone', 'Standard' ]) | ||
param dnsEndpointType string = 'Standard' | ||
param files array = [] | ||
param kind string = 'StorageV2' | ||
param minimumTlsVersion string = 'TLS1_2' | ||
param queues array = [] | ||
param shareDeleteRetentionPolicy object = {} | ||
param supportsHttpsTrafficOnly bool = true | ||
param tables array = [] | ||
param networkAcls object = { | ||
bypass: 'AzureServices' | ||
defaultAction: 'Allow' | ||
} | ||
@allowed([ 'Enabled', 'Disabled' ]) | ||
param publicNetworkAccess string = 'Enabled' | ||
param sku object = { name: 'Standard_LRS' } | ||
param keyVaultName string = '' | ||
|
||
resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = { | ||
name: name | ||
location: location | ||
tags: tags | ||
kind: kind | ||
sku: sku | ||
properties: { | ||
accessTier: accessTier | ||
allowBlobPublicAccess: allowBlobPublicAccess | ||
allowCrossTenantReplication: allowCrossTenantReplication | ||
allowSharedKeyAccess: allowSharedKeyAccess | ||
defaultToOAuthAuthentication: defaultToOAuthAuthentication | ||
dnsEndpointType: dnsEndpointType | ||
minimumTlsVersion: minimumTlsVersion | ||
networkAcls: networkAcls | ||
publicNetworkAccess: publicNetworkAccess | ||
supportsHttpsTrafficOnly: supportsHttpsTrafficOnly | ||
} | ||
|
||
resource blobServices 'blobServices' = if (!empty(containers)) { | ||
name: 'default' | ||
properties: { | ||
cors: { | ||
corsRules: corsRules | ||
} | ||
deleteRetentionPolicy: deleteRetentionPolicy | ||
} | ||
resource container 'containers' = [for container in containers: { | ||
name: container.name | ||
properties: { | ||
// todo: Warning use-safe-access: Use the safe access (.?) operator instead of checking object contents with the 'contains' function. [https://aka.ms/bicep/linter/use-safe-access] | ||
publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None' | ||
} | ||
}] | ||
} | ||
|
||
resource fileServices 'fileServices' = if (!empty(files)) { | ||
name: 'default' | ||
properties: { | ||
cors: { | ||
corsRules: corsRules | ||
} | ||
shareDeleteRetentionPolicy: shareDeleteRetentionPolicy | ||
} | ||
} | ||
|
||
resource queueServices 'queueServices' = if (!empty(queues)) { | ||
name: 'default' | ||
properties: { | ||
|
||
} | ||
resource queue 'queues' = [for queue in queues: { | ||
name: queue.name | ||
properties: { | ||
metadata: {} | ||
} | ||
}] | ||
} | ||
|
||
resource tableServices 'tableServices' = if (!empty(tables)) { | ||
name: 'default' | ||
properties: {} | ||
// create tables pre-defined in aspire.bicep | ||
resource table 'tables' = [for table in tables: { | ||
name: table | ||
properties: {} | ||
}] | ||
} | ||
} | ||
|
||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Save Storage Account Connection String in Key Vault Secret | ||
module keyVaultSecrets '../../core/security/keyvault-secret.bicep' = { | ||
name: 'keyVaultSecrets' | ||
params: { | ||
name: 'storage-connection-string' | ||
secretValue:'DefaultEndpointsProtocol=https;EndpointSuffix=${environment().suffixes.storage};AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};BlobEndpoint=${storage.properties.primaryEndpoints.blob};FileEndpoint=${storage.properties.primaryEndpoints.file};QueueEndpoint=${storage.properties.primaryEndpoints.queue};TableEndpoint=${storage.properties.primaryEndpoints.table}' | ||
justinyoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
keyVaultName:keyVaultName | ||
} | ||
} | ||
|
||
output id string = storage.id | ||
output name string = storage.name | ||
output primaryEndpoints object = storage.properties.primaryEndpoints |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.