Fundamentos de la nube y Azure
Certificaci贸n Microsoft Azure Fundamentals
Modelos de nube, p煤blica, privada e h铆brida
El modelo basado en consumo de la nube
Microsoft Azure Fundamentos
Creando tu cuenta de Azure
Instalaci贸n y configuraci贸n de la CLI de Azure
Aprende a administrar tu suscripci贸n de Azure
Explorando los recursos de Azure
Categor铆as de recursos en Azure
Aprendiendo a usar etiquetas en tus servicios
Conociendo las plantillas ARM
Desplegando recursos desde la CLI de Azure
Modelos de servicio
驴Qu茅 es la infraestructura como servicio?
驴Qu茅 es la plataforma como servicio?
驴Qu茅 es el software como servicio?
Los centros de datos de Azure, un gigante en crecimiento
Alta disponibilidad y organizaci贸n de recursos
Los conceptos m谩gicos de alta disponibilidad y escalabilidad
Niveles de acceso a tus recursos
驴C贸mo funciona la jerarqu铆a entre suscripciones, grupos de administraci贸n y grupos de recursos?
Seguridad y gobernanza en Azure
El concepto de Zero Trust
Principios de seguridad y gobernanza en Azure
Servicios de identidad como Microsoft Entra y Domain Services
M茅todos de autenticaci贸n en Azure
Azure role based access control
Soluciones de c贸mputo y redes
Tipos de c贸mputo, contenedores, m谩quinas virtuales y funciones
Componentes de una m谩quina virtual, Azure Virtual Machine Scale Set
Introducci贸n a las redes virtuales en Azure
Estableciendo un acceso p煤blico para mis m谩quinas virtuales
Almacenamiento y acceso seguro
Servicios de almacenamiento de Azure
Niveles de almacenamiento de Azure
Tipos de almacenamiento y opciones de cuenta
Azure Bastion
Herramientas avanzadas de seguridad
Microsoft Defender for Cloud
Introducci贸n a Azure Policy
Automatizaci贸n y despliegue de recursos
Usando Azure Cloud Shell
驴Qu茅 es Bicep?
Desplegando recursos con Bicep
驴Qu茅 es Azure Service Health?
Los portales adicionales de Azure
Arquitectura sin servidor
El modelo serverless
You don't have access to this class
Keep learning! Join and start boosting your career
The journey towards automating and creating cloud infrastructures has been revolutionized by tools such as Terraform and Bicep. While Terraform has been a favorite among practitioners for years, Bicep is quickly gaining traction in the Microsoft Azure environment. In this guide, we'll explore how to use Bicep to create flexible scripts that adapt to your needs, just as you would with Terraform.
The versatility of a script depends on its ability to handle variables and parameters effectively. In Bicep, as in Terraform, you can use parameters to improve the flexibility and reusability of your scripts.
Create parameters: Parameters in Bicep are like variables that you can define in your scripts. By adding descriptions and rules, such as a minimum length, you ensure that strings are not empty and meet certain criteria.
Define common parameters:
Substitute static values: once the parameters are defined, you can replace the static strings in your script with these parameters, increasing the flexibility of your script.
param storageAccountName string { description: 'Storage account name' allowedPattern: '^'}
To manage configurations centrally, the use of a variables file is recommended. This makes it easier to manage configurations for different environments without modifying the main script.
Create a JSON file for parameters: within your Bicep project, create a main.parameters.json
file where you can define all your variables. This file will follow the format that Bicep recognizes.
Example JSON structure:
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "location": { "value": "East US 2" }, "storageAccountName": { "value": "myuniquestorage" } }} } }
Integrating a Bash script allows you to automate the creation and deployment of resources, significantly simplifying the process.
Create the deployment script: a file called deploy.sh
can contain commands to automate resource deployment.
Script structure:
#!/bin/bash resourceGroup="internal-bicep-rg" location="East US 2"# Create resource groupaz group create --name $resourceGroup --location $location# Deploy Bicep resourcesaz deployment group create --resource-group $resourceGroup --template-file main.bicep --parameters @main.parameters.json
deploy.sh
, you automate tasks with convenience, maximizing your time for other activities.Once you have configured your scripts and parameters, it is crucial to verify that everything works as intended.
In summary, using Bicep in combination with other scripting and command tools such as the AZ CLI greatly enhances your deployment and management capabilities in Azure. By investing time in creating parameterized and automated scripts, you not only optimize processes, but also become a more efficient and effective professional. Keep exploring and honing your skills!
Contributions 0
Questions 0
Want to see more contributions, questions and answers from the community?