Skip to content

Commit

Permalink
Merge pull request #197 from ElYusubov/development
Browse files Browse the repository at this point in the history
Minor change to ACR repo and bicep code for demo
  • Loading branch information
ElYusubov authored Jan 15, 2025
2 parents 5cb9086 + 88a7201 commit a4b8d48
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 73 deletions.
4 changes: 2 additions & 2 deletions bicepconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"registry": "mcr.microsoft.com",
"modulePath": "bicep"
},
"PrivateDemo": {
"registry": "latamprivateregistry.azurecr.io",
"CloudRegistry": {
"registry": "cloudwithus01.azurecr.io",
"modulePath": "bicep/modules"
}
}
Expand Down
38 changes: 0 additions & 38 deletions modules/acr-registry.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,3 @@ resource acrResource 'Microsoft.ContainerRegistry/registries@2021-06-01-preview'

@description('Output the login server property for later use')
output loginServer string = acrResource.properties.loginServer

// Sample on Insert Resource
// @description('Generated from exisiting storage account')
// resource bsuniquesmb 'Microsoft.Storage/storageAccounts@2022-09-01' = {
// sku: {
// name: 'Standard_GRS'
// }
// kind: 'StorageV2'
// name: 'bs27uniquesmb928'
// location: 'eastus'
// tags: {
// }
// properties: {
// minimumTlsVersion: 'TLS1_0'
// allowBlobPublicAccess: true
// networkAcls: {
// bypass: 'AzureServices'
// virtualNetworkRules: []
// ipRules: []
// defaultAction: 'Allow'
// }
// supportsHttpsTrafficOnly: true
// encryption: {
// services: {
// file: {
// keyType: 'Account'
// enabled: true
// }
// blob: {
// keyType: 'Account'
// enabled: true
// }
// }
// keySource: 'Microsoft.Storage'
// }
// accessTier: 'Hot'
// }
// }
3 changes: 0 additions & 3 deletions modules/appservice.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,3 @@ resource appServiceApp 'Microsoft.Web/sites@2020-06-01' = {

@description('Provides a deployed apps host name.')
output webAppHostName string = appServiceApp.properties.defaultHostName

// insert resource - elyusubov Application Insights
// /subscriptions/3xxx8fb/resourceGroups/rg-blog/providers/microsoft.insights/components/elyusubov
16 changes: 8 additions & 8 deletions modules/storage.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ resource storageaccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
}

// Creates a second storage account
resource secondStorage 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: 'secstg01${prefix}'
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
}
// resource secondStorage 'Microsoft.Storage/storageAccounts@2021-02-01' = {
// name: 'secstg01${prefix}'
// location: location
// kind: 'StorageV2'
// sku: {
// name: 'Standard_LRS'
// }
// }
27 changes: 19 additions & 8 deletions samples/15-deploy-private-repo.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@

// Step-4: Call the private module in your Bicep code

// module regAppService 'br:azwelshug0315.azurecr.io/bicep/modules/appservice:v1' = {
// name: 'appServiceDeploy'
module regAppService 'br:cloudwithus01.azurecr.io/bicep/modules/appservice:v1.0.0' = {
name: 'appServiceDeploy'
params: {
location: 'eastus2'
appServiceAppName: 'cloudwithus-demo-01'
}
}

// module regStorage 'br:cloudwithus01.azurecr.io/bicep/modules/storage:v1.0.0' = {
// name: 'storageDeploy'
// params: {
// location: 'eastus'
// appServiceAppName: 'azwelshug0315'
// azureRegion: 'eastus2'
// geoRedundancy: false
// namePrefix: 'dev'
// }
// }

module regAppService2 'br/CoreModules:appservice:v2' = {
name: 'appServiceDeploy2'
// CloudRegistry
module regNewStorage 'br/CloudRegistry:storage:v1.0.0' = {
name: 'storageDeploy2'
params: {
location: 'eastus'
appServiceAppName: 'newapp031555'
azureRegion: 'eastus2'
geoRedundancy: false
namePrefix: 'test'
}
}
30 changes: 16 additions & 14 deletions scripts/deploy-private-acr.azcli
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,38 @@ az account show --query name
# List all RG names
az group list -o table

# Deploy 15-deploy-private =-repo.bicep
az group create --name cllnov01 --location eastus
az deployment group create --resource-group cllnov01 --template-file .\modules\acr-registry.bicep --parameters acrName=clldemonov2023 -c
# Deploy acr registry as a bicep file
az group create --name cloud-demo01 --location eastus
az deployment group create --resource-group cloud-demo01 --template-file .\modules\acr-registry.bicep --parameters acrName=cloudwithus01 -c

# List all the ACR accounts
az acr list -o table
az acr list --query [].name -o table

# Get login server name
az acr show --resource-group cllnov01 --name clldemonov2023.azurecr.io --query loginServer
# Sample response: clldemonov2023.azurecr.io
az acr show --resource-group cloud-demo01 --name cloudwithus01.azurecr.io --query loginServer
# Sample response: cloudwithus01.azurecr.io

### ----------------------- ###

az acr repository list --name clldemonov2023.azurecr.io --output table
az acr repository list --name cloudwithus01.azurecr.io --output table

# Publish modules/storage-param.bicep
az bicep publish --file .\modules\storage-param.bicep --target br:clldemonov2023.azurecr.io/bicep/modules/storage:v1.0.0
# Artifact reference clldemonov2023.azurecr.io/bicep/modules/storage:v1.0.0

az bicep publish --file .\modules\storage-param.bicep --target br:cloudwithus01.azurecr.io/bicep/modules/storage:v1.0.0
# Artifact reference cloudwithus01.azurecr.io/bicep/modules/storage:v1.0.0

# Publish modules/appservice.bicep
az bicep publish --file .\modules\appservice.bicep --target br:clldemonov2023.azurecr.io/bicep/modules/appservice:v2
# Artifact reference clldemonov2023.azurecr.io/bicep/modules/appservice:v1
az bicep publish --file .\modules\appservice.bicep --target br:cloudwithus01.azurecr.io/bicep/modules/appservice:v1.0.0
# Artifact reference cloudwithus01.azurecr.io/bicep/modules/appservice:v1.0.0

# Deploy Azure resources using private Bicep registry
az deployment group create -g 'cllnov01' -f .\samples\15-deploy-private-repo.bicep -c
# Deploy Azure resources using private Bicep registry from 15-deploy-private-repo.bicep file
az deployment group create -g 'cloud-demo01' -f .\samples\15-deploy-private-repo.bicep -c

# Query the list of exisiting web apps
az webapp list -o table

# List storage account names on Subscription
az storage account list --query "[].{name:name}" --output table

# Display an existing web app
az webapp show -g cllnov01 --name newapp031555 -o table
az webapp show -g cloud-demo01 --name cloudwithus-demo-01 -o table

0 comments on commit a4b8d48

Please sign in to comment.