ChatGPT to author Bicep templates?
Freek Berson
Empowering hybrid and remote workforces with a digital workspace from any device, anywhere. EUC Enthusiast, Microsoft MVP, ?? public speaker, ?? Author. #Parallels #Alludo #AVD #RDS #Bicep ?? #Automation
I'm sure that by now many have heard about ChatGPT. If not, ChatGPT is a large language model developed by OpenAI. It is based on the GPT (Generative Pre-training Transformer) architecture, which was trained on a massive amount of text data to generate human-like text. ChatGPT is fine-tuned to perform specific language tasks such as answering questions, generating text and more. It uses the latest advances in neural network technology to understand and respond to natural language input in a way that mimics human conversation. It can be used for various applications such as chatbots, automated customer service, language translation and more.
I took ChatGPT for a spin to see how accurate and detailed it would be to write (Infra as) Code. Somehow Bicep felt like a good candidate! (in case you don't know why, follow this link ??)
The first question I asked was to author a simple Bicep template to create a Vnet.
I was blown away by the initial response which came back instantly! That looks awesome for a first try! Do note that ChatGPT says Bicep is still in preview. The reason is that ChatGPT is trained on a large dataset of text data that was current as of 2021, so it may not have information that is more recent than that. The training data used to build the model is also constantly being updated, so the information available to ChatGPT may change over time.
Also note that ChatGPT gave some advise on network designs as well, how cool is that!
A best practice however would be to use a parameter instead of 'resourceGroup().location'. So lets tell ChatGPT to adapt to that and also tell it to to make resourceGroup().location the default value of the parameter.
That was easy! Next, we'll tell it to use a different API version when dealing with VNets.
领英推荐
There we go. Finally, lets see if it can also generate a parameters file with a couple of sample values. Of course it can!
And this is just scratching the surface on what ChatGPT is able to do based on a simple example, there is so much more!
ChatGPT can help with writing code by providing code snippets, examples, and templates for a specific programming language or framework. It can also help with troubleshooting errors by providing solutions to common problems. Additionally, ChatGPT can assist with understanding the proper syntax and usage of a particular command or function by providing explanations and documentation.
ChatGPT can also help with writing code by providing suggestions for code improvements and better practices and by suggesting alternative ways to implement a certain functionality. It can also help with understanding and working with complex code by providing explanations of the code's behavior and providing examples of how to use it.
It's important to note that while ChatGPT can help with writing code, it's not a replacement for human programmers. ChatGPT can provide suggestions and examples, but it can't replace the experience and understanding of the problem domain that a human developer has.
Strong advise: do not blindly trust AI generated code for production environments. Use AI to assist you, not to replace you.
And guess what...part of this article was actually written by ChatGPT itself! Did you notice that? The possibilities are endless and I'm looking forward to test driving this some more! What are your thoughts?
Senior Consultant/Senior Project Engineer specializing in Citrix, NetScaler, Cybersecurity, and Modern Workplace solutions.
1 年I like the idea of a copilot to help with scripting in general. And I did manage to try out Bicep templates with ChatGPT a while back. It looks promising, that's all I will say but will require further investigation on my part. Thanks for sharing!
Azure Solutions Architect
1 年Hi Freek, awesome post. I have been using chatgpt as well for some test cases, how ever due to limitation of data content till 2021 a lot of new bicep knowledge is not present. For example new private endpoints for resources that have been developed after this date. According to chatgpt , the lasted version of bicep is 0.4 released on sept 8 2021. I hope they will update their data soon as hthis has so many great opportunities.
2x Azure / WebDev / .NET / API / Blogger
1 年Nice, To the point. Use AI to assist you, not to replace you.
Empowering hybrid and remote workforces with a digital workspace from any device, anywhere. EUC Enthusiast, Microsoft MVP, ?? public speaker, ?? Author. #Parallels #Alludo #AVD #RDS #Bicep ?? #Automation
1 年https://azure.microsoft.com/en-us/blog/general-availability-of-azure-openai-service-expands-access-to-large-advanced-ai-models-with-added-enterprise-benefits/ OpenAI - Microsoft - #Azure - #ChatGPT
Unifying the physical and virtual worlds of EUC | Bringing new products to market | Leading sales and presales
1 年I've been using this internally a lot, I built a basic android and iOS app last Sunday in about 4 hours and I haven't coded anything in about 7 years. It's not perfect and you still need a strong coding background but if you know the foundations it's an outstanding pair programmer.