Alex Amigo
Digital Marketing Manager
*Aktualisierter Beitrag mit den neuesten verfügbaren Nachrichten
Bicep ist die DSL (Domain Specific Language) zur deklarativen Bereitstellung von Azure-Ressourcen. Sie zielt darauf ab, die Erfahrung zu vereinfachen, die wir derzeit mit ARM-Templates für die Bereitstellung von Azure-Ressourcen machen, mit einer saubereren Syntax, Modularität und Wiederverwendbarkeit.
Es bietet eine transparente Abstraktion über ARM-Templates (wir wissen, dass ARM-Templates nicht die am einfachsten zu erstellenden sind), alle Dinge, die wir bisher (und in Zukunft) mit ARM-Templates machen können, können mit Bicep gemacht werden (mit Ausnahme von bekannten Einschränkungen, von denen Microsoft erwartet, dass sie in weiteren Versionen gelöst werden). Es ist jedoch für den Produktionseinsatz bereit. Mit Hilfe von Bicep und einigen der in diesem Beitrag vorgestellten Werkzeuge ist es nun viel einfacher, ARM-Vorlagen zu erstellen.
Daher wollte ich eine einfache Einführung machen, weil ich es nützlich finde, etwas über diese neue DSL, ihre Einfachheit und ihre Funktionen gegenüber herkömmlichen ARM-Templates zur Bereitstellung von Azure-Ressourcen zu erfahren. Sie wird es Entwicklern ermöglichen, ARM-Vorlagen schneller und einfacher als je zuvor zu erstellen.
Es gibt bereits Alternativen wie Terraform, Pulumi, und andere IaC-Angebote, um die Komplexität von ARM-Templates zu vermeiden… Nun, ich möchte zugeben, dass ich Terraform für Azure in einigen Projekten verwendet habe und sehr zufrieden damit bin, seine Azure-Provider sind wirklich großartig, aber in einigen Fällen, mit neuen Azure-Funktionen, Produkten oder Konfigurationen, müssen wir darauf warten, dass der Provider diese Änderungen implementiert (oder sie sind in absehbarer Zeit nicht verfügbar, wie die Azure Portal Integration). Die Verwendung des “AzAPI Provider” anstelle des “AzureRM Provider” löst die Wartezeit, bis der Provider die Unterstützung für die neuesten Änderungen in Azure implementiert. Wenn wir den “AzAPI Provider” verwenden, nutzen wir dieselbe API, die Bicep für die Bereitstellung von Ressourcen verwendet. Dennoch müssen wir uns mit dem Terraform-Status auseinandersetzen, ohne Azure Portal-Integration und ohne einige Integrationsfunktionen wie Azure Policies.
Stattdessen ist Bicep seit der Version 0.3 in allen Azure Support Plänen enthalten. Da es direkt in Standard-ARM-Template-JSON-Dateien kompiliert wird und von Microsoft unterstützt und gesichert wird, sollten alle neuen Funktionen, Produkte und Konfigurationen sofort verfügbar sein (was sehr beruhigend ist), ebenso wie eine großartige Azure-Portal-Integration und eine bessere Integration.

Azure Resource Manager Architekturschema (Auszug aus “Project Bicep Demo at Ignite 2020 by Mark Russinovich”)
Meiner Meinung nach ist es für Entwickler, die Ressourcen auf Azure bereitstellen, einen Versuch wert. Es ist jedoch wichtig zu betonen, dass es keinen Grund gibt, auf Bicep umzusteigen, wenn Sie bereits Terraform oder einen anderen IaC-Anbieter verwenden, da die Anbieter sich sehr bemühen, dass sie gut mit Azure zusammenarbeiten, und Microsoft selbst unterstützt diese Bemühungen. Die Realität ist, dass es so viele Projekte gibt, die ARM-Templates verwenden, und Microsoft versucht, die Verwaltung zu vereinfachen und sein eigenes Tooling bereitzustellen, um mit IaC zu beginnen (ohne von dritten Quellen abhängig zu sein).
Was sind die Unterschiede zwischen Bicep und Terraform? Beides sind zwei führende IaC (Infrastructure as Code) Angebote. Was die Infrastruktur, die Integration und die Benutzerfreundlichkeit angeht, haben beide sehr benutzerfreundliche Funktionen, was sie in einigen Aspekten sehr ähnlich macht. Ein wichtiges Konzept, das man kennen sollte, ist, dass es bei der Verwendung von Bicep im Vergleich zu Terraform keine wichtigen Benutzerfreundlichkeitsmerkmale gibt.
Ihre Infrastruktur und Integrationsfunktionen erleichtern Entwicklern die Implementierung von IaC-Lösungen. Die einzige wichtige Entscheidung, die Sie treffen müssen, ist die, ob Sie mehr als einen Cloud-Anbieter nutzen wollen (oder ob Ihre Infrastruktur aus einer Multi-/Hybrid-Cloud-Umgebung bestehen wird). Wenn ja, dann ist Terraform am besten für Sie geeignet, da Bicep ausschließlich für Azure-Ressourcen gedacht ist.
Bei einem detaillierteren Vergleich gibt es einige wichtige Unterschiede, die wir kennen sollten:
Berücksichtigen Sie die vorstehenden Konzepte (und Ihre Infrastrukturanforderungen und -präferenzen), um die beste Wahl für Ihr Unternehmen zu treffen.
Die ersten Schritte sind sehr einfach. Wir benötigen nur das Azure CLI. Es liegt an Ihnen, andere Tools zu installieren (CLI, die VS-Code-Erweiterung, etc.). Der Prozess für diese Tools ist einfach und in ihrem Repository dokumentiert. Beachten Sie, dass es auch ein Bicep PowerShell Modul gibt, wenn wir einen großartigen Wrapper für die Bicep CLI in PowerShell haben wollen.
Der nächste Schritt ist, sich mit Bicep und seiner Syntax vertraut zu machen. Ein guter Startpunkt ist das offizielle Tutorial. Es gibt auch großartige Ressourcen, um Bicep auszuprobieren, wie den Bicep Playground und das Visual Studio Code Devcontainer/Codespaces repo.
Nach diesem Prozess und nachdem wir eine Weile gespielt haben, sollten wir bereit sein, es zu benutzen und unsere Azure Deployment Templates zu erleichtern.

Projekt Bicep Schema (Auszug aus “Project Bicep Demo at Ignite 2020 by Mark Russinovich”)
Interpretiert man das obige Schema, wäre der Prozess so einfach wie:
bicep build my-deployment.bicep # Nur dieser zusätzliche Schritt
az deployment group create my-deployment.json
Aber wir können diesen zusätzlichen Schritt überspringen! Denn sowohl Az CLI (2.20.0+) als auch das PowerShell Az Modul (v5.6.0+) haben Bicep Unterstützung eingebaut:
az deployment group create my-deployment.bicep
Mit Bicep vereinfachen wir den Prozess der Erstellung von ARM-Vorlagen erheblich und erhalten viele Vorteile. Einer davon, den ich sehr interessant finde, ist die Möglichkeit, separate Bicep-Dateien zu erstellen, um eine einzige ARM-Datei zu generieren, also die Modularitätsfunktion.
Werfen wir einen kurzen Blick auf die Unterschiede zwischen einer Bicep- und einer ARM-Datei (die gleichwertig sind), von einer einfachen Schnellstartvorlage aus dem Azure Repo:

Deployment einer einfachen SQL-Datenbank in nur der Hälfte der Zeilen viel lesbarer (Links: Bicep. Rechts: ARM)
Sieht einfach aus und ist es auch, aber…
Es gibt zwei verschiedene Ansätze:
Dennoch ist es wichtig zu betonen, dass, da Bicep zu ARM-Templates kompiliert, wir auch Bicep und ARM-Templates gleichzeitig existieren lassen könnten und die Templates inkrementell konvertieren oder die alten als Standard-ARM-Templates belassen könnten (je nach Wunsch des Entwicklers).
Der Ansatz in unserem Deployment-Prozess wird fast derselbe sein, da wir nur einen zusätzlichen Schritt in unserem Deployment-Prozess einführen: die Kompilierung von Bicep-Dateien in ihr JSON-ARM-Template-Äquivalent, bevor wir die ARM-Templates deployen.
Da es sich bei Bicep “nur” um ein Tool handelt, könnten wir die Kompilierung von Bicep-Dateien in fast jeder Umgebung leicht implementieren. Ein einfacher und generischer Ansatz wäre es, das Binary von den GitHub-Releases herunterzuladen und das Binary mit unseren Bicep-Dateien in JSON auszuführen. Dies ist jedoch, wie bereits erwähnt, mit den neueren Versionen von Azure CLI und dem PowerShell Az-Modul überhaupt nicht mehr notwendig.
Während es einfach ist, diesen generischen Ansatz zu implementieren, fangen die Community und Microsoft selbst an, uns die notwendigen Erweiterungen, Pakete und Aktionen zur Verfügung zu stellen, um das Bicep-Tooling (wenn wir es brauchen) in unsere Pipelines einzubinden.
Für Azure DevOps Pipelines habe ich bereits einige Aufgaben implementiert, um den Prozess für Bicep zu abstrahieren und zu vereinfachen, die in der README des offiziellen Projekts oder auf dem Visual Studio Marketplace zu finden sind.
Wer jedoch keine Erweiterungen von Drittanbietern in seine Azure DevOps-Organisation einbinden möchte, kann eine eigene Pipeline erstellen (und das Tooling selbst herunterladen).
Es gibt eine von der Community entwickelte GitHub Action, um Bicep in unseren Deployment-Prozess einzubinden, wenn wir GitHub Actions verwenden. Wie im Abschnitt Azure DevOps Pipelines erwähnt, können wir unsere eigene Action implementieren (indem wir das Tooling selbst herunterladen).
Bicep ist nur eine Binärdatei, die plattformübergreifend laufen kann. Daher denke ich, dass es heutzutage in jeder CI/CD-Umgebung kein Problem wäre, einen zusätzlichen Schritt zur Handhabung von ‘.bicep’-Dateien einzuführen. Beachten Sie, dass dies nur für die Bereitstellung überhaupt nicht notwendig ist.
Es wäre nur eine ausführbare Datei, die bei jedem Lauf heruntergeladen oder in unserer Umgebung gespeichert werden könnte, die wir gegen eine Reihe von ‘.bicep’-Dateien ausführen müssen.
Es gibt wirklich keinen Grund, sich mit Microsoft Bicep anzufreunden…
Es gibt noch viel mehr zu entdecken (und es werden noch weitere Funktionen hinzukommen!), aber vorerst möchten wir Ihnen diese Reihe erster Konzepte vorstellen, damit Sie testen können, was Project Bicep zu bieten hat.
Alex Amigo
Digital Marketing Manager
| Cookie | Duration | Description |
|---|---|---|
| __cfduid | 1 year | The cookie is used by cdn services like CloudFare to identify individual clients behind a shared IP address and apply security settings on a per-client basis. It does not correspond to any user ID in the web application and does not store any personally identifiable information. |
| __cfduid | 29 days 23 hours 59 minutes | The cookie is used by cdn services like CloudFare to identify individual clients behind a shared IP address and apply security settings on a per-client basis. It does not correspond to any user ID in the web application and does not store any personally identifiable information. |
| __cfduid | 1 year | The cookie is used by cdn services like CloudFare to identify individual clients behind a shared IP address and apply security settings on a per-client basis. It does not correspond to any user ID in the web application and does not store any personally identifiable information. |
| __cfduid | 29 days 23 hours 59 minutes | The cookie is used by cdn services like CloudFare to identify individual clients behind a shared IP address and apply security settings on a per-client basis. It does not correspond to any user ID in the web application and does not store any personally identifiable information. |
| _ga | 1 year | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
| _ga | 1 year | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
| _ga | 1 year | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
| _ga | 1 year | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
| _gat_UA-326213-2 | 1 year | No description |
| _gat_UA-326213-2 | 1 year | No description |
| _gat_UA-326213-2 | 1 year | No description |
| _gat_UA-326213-2 | 1 year | No description |
| _gid | 1 year | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form. |
| _gid | 1 year | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form. |
| _gid | 1 year | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form. |
| _gid | 1 year | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form. |
| attributionCookie | session | No description |
| cookielawinfo-checkbox-analytics | 1 year | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Analytics" category . |
| cookielawinfo-checkbox-necessary | 1 year | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-necessary | 1 year | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-non-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Non Necessary". |
| cookielawinfo-checkbox-non-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Non Necessary". |
| cookielawinfo-checkbox-non-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Non Necessary". |
| cookielawinfo-checkbox-non-necessary | 1 year | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Non Necessary". |
| cookielawinfo-checkbox-performance | 1 year | Set by the GDPR Cookie Consent plugin, this cookie is used to store the user consent for cookies in the category "Performance". |
| cppro-ft | 1 year | No description |
| cppro-ft | 7 years 1 months 12 days 23 hours 59 minutes | No description |
| cppro-ft | 7 years 1 months 12 days 23 hours 59 minutes | No description |
| cppro-ft | 1 year | No description |
| cppro-ft-style | 1 year | No description |
| cppro-ft-style | 1 year | No description |
| cppro-ft-style | session | No description |
| cppro-ft-style | session | No description |
| cppro-ft-style-temp | 23 hours 59 minutes | No description |
| cppro-ft-style-temp | 23 hours 59 minutes | No description |
| cppro-ft-style-temp | 23 hours 59 minutes | No description |
| cppro-ft-style-temp | 1 year | No description |
| i18n | 10 years | No description available. |
| IE-jwt | 62 years 6 months 9 days 9 hours | No description |
| IE-LANG_CODE | 62 years 6 months 9 days 9 hours | No description |
| IE-set_country | 62 years 6 months 9 days 9 hours | No description |
| JSESSIONID | session | The JSESSIONID cookie is used by New Relic to store a session identifier so that New Relic can monitor session counts for an application. |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| viewed_cookie_policy | 1 year | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| viewed_cookie_policy | 1 year | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| VISITOR_INFO1_LIVE | 5 months 27 days | A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface. |
| wmc | 9 years 11 months 30 days 11 hours 59 minutes | No description |
| Cookie | Duration | Description |
|---|---|---|
| __cf_bm | 30 minutes | This cookie, set by Cloudflare, is used to support Cloudflare Bot Management. |
| sp_landing | 1 day | The sp_landing is set by Spotify to implement audio content from Spotify on the website and also registers information on user interaction related to the audio content. |
| sp_t | 1 year | The sp_t cookie is set by Spotify to implement audio content from Spotify on the website and also registers information on user interaction related to the audio content. |
| Cookie | Duration | Description |
|---|---|---|
| _hjAbsoluteSessionInProgress | 1 year | No description |
| _hjAbsoluteSessionInProgress | 1 year | No description |
| _hjAbsoluteSessionInProgress | 1 year | No description |
| _hjAbsoluteSessionInProgress | 1 year | No description |
| _hjFirstSeen | 29 minutes | No description |
| _hjFirstSeen | 29 minutes | No description |
| _hjFirstSeen | 29 minutes | No description |
| _hjFirstSeen | 1 year | No description |
| _hjid | 11 months 29 days 23 hours 59 minutes | This cookie is set by Hotjar. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID. |
| _hjid | 11 months 29 days 23 hours 59 minutes | This cookie is set by Hotjar. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID. |
| _hjid | 1 year | This cookie is set by Hotjar. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID. |
| _hjid | 1 year | This cookie is set by Hotjar. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID. |
| _hjIncludedInPageviewSample | 1 year | No description |
| _hjIncludedInPageviewSample | 1 year | No description |
| _hjIncludedInPageviewSample | 1 year | No description |
| _hjIncludedInPageviewSample | 1 year | No description |
| _hjSession_1776154 | session | No description |
| _hjSessionUser_1776154 | session | No description |
| _hjTLDTest | 1 year | No description |
| _hjTLDTest | 1 year | No description |
| _hjTLDTest | session | No description |
| _hjTLDTest | session | No description |
| _lfa_test_cookie_stored | past | No description |
| Cookie | Duration | Description |
|---|---|---|
| loglevel | never | No description available. |
| prism_90878714 | 1 month | No description |
| redirectFacebook | 2 minutes | No description |
| YSC | session | YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages. |
| yt-remote-connected-devices | never | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
| yt-remote-device-id | never | YouTube sets this cookie to store the video preferences of the user using embedded YouTube video. |
| yt.innertube::nextId | never | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |
| yt.innertube::requests | never | This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen. |