소스 검색

Merge pull request #2541 from anthony-c-martin/patch-1

Add Bicep sample
Alexandru Dima 4 년 전
부모
커밋
58344d47d1
3개의 변경된 파일62개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      test/samples-all.generated.js
  2. 29 0
      test/samples/sample.bicep.txt
  3. 29 0
      website/index/samples/sample.bicep.txt

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 0
test/samples-all.generated.js


+ 29 - 0
test/samples/sample.bicep.txt

@@ -0,0 +1,29 @@
+targetScope = 'subscription'
+
+param deployStorage bool = true
+
+@description('The object ID of the principal that will get the role assignment')
+param aadPrincipalId string
+
+module stg './storage.bicep' = if(deployStorage) {
+  name: 'storageDeploy'
+  scope: resourceGroup('another-rg') // this will target another resource group in the same subscription
+  params: {
+    storageAccountName: '<YOURUNIQUESTORAGENAME>'
+  }
+}
+
+var contributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
+  name: contributor
+}
+
+resource rbac 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
+  name: guid(subscription().id, aadPrincipalId, contributor)
+  properties: {
+    roleDefinitionId: roleDef.id
+    principalId: aadPrincipalId
+  }
+}
+
+output storageName array = stg.outputs.containerProps

+ 29 - 0
website/index/samples/sample.bicep.txt

@@ -0,0 +1,29 @@
+targetScope = 'subscription'
+
+param deployStorage bool = true
+
+@description('The object ID of the principal that will get the role assignment')
+param aadPrincipalId string
+
+module stg './storage.bicep' = if(deployStorage) {
+  name: 'storageDeploy'
+  scope: resourceGroup('another-rg') // this will target another resource group in the same subscription
+  params: {
+    storageAccountName: '<YOURUNIQUESTORAGENAME>'
+  }
+}
+
+var contributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c'
+resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
+  name: contributor
+}
+
+resource rbac 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
+  name: guid(subscription().id, aadPrincipalId, contributor)
+  properties: {
+    roleDefinitionId: roleDef.id
+    principalId: aadPrincipalId
+  }
+}
+
+output storageName array = stg.outputs.containerProps

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.