You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/en/2025-03-05-integrating-backstage-azure-devops.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ I'll keep a repository on my GitHub with the Backstage code resulting from these
41
41
42
42
For this post, I created a new project in Azure DevOps called Backstage, where we will store our Backstage template, Terraform code, and the yaml file to create our pipeline.
43
43
44
-
>⚠️**Attention**: I will assume that you already know how to create a project, repository, and use the minimum necessary git commands.
44
+
>**Attention**: I will assume that you already know how to create a project, repository, and use the minimum necessary git commands.
45
45
{: .prompt-warning}
46
46
47
47
[In this link](https://backstage.io/docs/integrations/azure/locations) you can check the Backstage documentation for this integration. Backstage supports the use of managed identity, service principal, and PAT. For the purpose of this post, I will use PAT as it is simpler.
@@ -241,11 +241,12 @@ spec:
241
241
entityRef: {% raw %}${{ steps.register.output.entityRef }}{% endraw %}
242
242
```
243
243
244
-
> ⚠️**Important Note about Templates**⚠️:
244
+
> **Important Note about Templates**:
245
245
>
246
246
> When using relative paths for file handling in Backstage, it **always** starts from the location where **the template was imported**.
247
247
>
248
248
> In other words, it always concatenates the path you provide with the path from where the template was imported. Thus, either you keep the files to be handled in the same location as the file from which you imported the template or use a URL from an external location, which is the approach I used here in the `fetch:template` action. More about this can be seen [here](https://backstage.io/docs/features/software-templates/) and [here](https://backstage.io/docs/tooling/cli/templates/).
249
+
{: .prompt-warning }
249
250
250
251
Returning to our process, create the template file in Azure DevOps (replacing the necessary fields) and then go to Backstage and follow the same import process we did before in the integration test. When importing the template, you might encounter the error below:
⚠️ I am not using a storage account here to store your Terraform state! For production environments, I suggest storing the state in a secure location.
282
+
> I am not using a storage account here to store your Terraform state! For production environments, I suggest storing the state in a secure location.
283
+
{: .prompt-tip }
282
284
283
285
Pay attention to the `name` variable, as it will be filled with the value coming from Backstage. Here we are making a very simple example using only one variable, but extrapolate this idea to any code you want to execute.
284
286
285
287
Once the Terraform code is created, upload it to our Azure DevOps repository.
286
288
287
-
💡 **Important**: since the idea is for Backstage to handle this file and then upload it and subsequently create a Pull Request of code, this (containing the `name` variable) will be replaced by the value coming from Backstage, making the code **non-reusable**.
289
+
> **Important**: since the idea is for Backstage to handle this file and then upload it and subsequently create a Pull Request of code, this (containing the `name` variable) will be replaced by the value coming from Backstage, making the code **non-reusable**.
288
290
To avoid this, we will separate the code with the variable, which we will call `base`, from the code that will have the variable filled, which we will call `changed`, for simplicity. This way, we will always have a place with the code ready to be used.
291
+
{: .prompt-info }
289
292
290
293
Below is the approach I find the simplest, but feel free to adapt it to your needs:
0 commit comments