Coding, How to

Easily Debugging Terraform Provider for Azure in VSCode

So you’re making a change to the provider to add a feature, it’s going great and your ready to test it out…. but then you realize things get a bit ropey… ideally you want a visual debugger to step through the code.

Well here is how to set that up in VSCode.

First make sure you have VSCode setup for golang debugging (delve configured etc). Then it’s easy, say you want to debug a new provider you’ve written and it has a test called TestAccDataSourceAzureRMFunction_basic in the file data_source_function_test.go then you can setup your launch.json file in VSCode to look like:

(Makes sure you replace the details in the private.env with your service principal and subscription details)



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s