Adding resource "azurerm_static_web_app_build" to set environment variables for Preview Environment #28096
+194
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Note
Description
This pull request introduces a new resource,
azurerm_static_web_app_build
, designed to configure environment variables specifically for the preview environment of a static web app. The existingazurerm_static_web_app
resource only supports setting environment variables for the production environment via theapp_settings
property.Below is an example of how to use the resource.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Because it needs to deploy something to the Static Web to create a preview environment, which is not currently supported without SWA or AZ cli, the tests are done manually. Please find the test evidence below.
Create a new resource
![Screenshot 2024-11-24 at 21 29 15](https://private-user-images.githubusercontent.com/2035274/389258285-1ca4343f-83d8-4c0e-9125-6ebba18e95a9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MDQ4MzksIm5iZiI6MTczOTkwNDUzOSwicGF0aCI6Ii8yMDM1Mjc0LzM4OTI1ODI4NS0xY2E0MzQzZi04M2Q4LTRjMGUtOTEyNS02ZWJiYTE4ZTk1YTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTg0ODU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTU4YWU2NGY0MzM5MmUzMjIwMjU4YWFkMmE2OWU4ZTdlYTg3OGFmNDNmMGE2YWU0OTRjMDhmNmVmOWJhMzBiZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6JoeeKe2puHwUbMOZbL3e2bmQld8lsB7VC9oG8FEwxI)
![Screenshot 2024-11-24 at 21 29 33](https://private-user-images.githubusercontent.com/2035274/389258295-32fbde2d-4197-4e03-9dbe-ab19bfecfb48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MDQ4MzksIm5iZiI6MTczOTkwNDUzOSwicGF0aCI6Ii8yMDM1Mjc0LzM4OTI1ODI5NS0zMmZiZGUyZC00MTk3LTRlMDMtOWRiZS1hYjE5YmZlY2ZiNDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTg0ODU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTUxMDI3NTI5Mzg5YjliN2Q0NjUzODNhM2VlNmViMjVhMDgzNDEwOWY2ZjE0MjYzMzNkMjA2YWU3M2VkMDUwOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.WHDC_bt7YHqoUq6p84VFHEq4N-OITbrtHyO1EijtzN8)
Destroy a resource
![Screenshot 2024-11-24 at 21 30 13](https://private-user-images.githubusercontent.com/2035274/389258294-4aaf0488-2dcb-47ca-8bfb-dc9e322a8e0c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MDQ4MzksIm5iZiI6MTczOTkwNDUzOSwicGF0aCI6Ii8yMDM1Mjc0LzM4OTI1ODI5NC00YWFmMDQ4OC0yZGNiLTQ3Y2EtOGJmYi1kYzllMzIyYThlMGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTg0ODU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjYzOGY2YTljYjRhMTM0MTAzMjA0ZDVmYjc5NjRhZDRmODQxZGUzZTViZDZlYThkZDE5YjA2MWI1M2UzZDYxNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XiD9jU22WBxq0-zjl_2YA5msuP41EABxHkYqdWtCgCU)
![Screenshot 2024-11-24 at 21 30 24](https://private-user-images.githubusercontent.com/2035274/389258292-3ed660df-589f-4afc-9945-ca79f3eacac8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MDQ4MzksIm5iZiI6MTczOTkwNDUzOSwicGF0aCI6Ii8yMDM1Mjc0LzM4OTI1ODI5Mi0zZWQ2NjBkZi01ODlmLTRhZmMtOTk0NS1jYTc5ZjNlYWNhYzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTg0ODU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGFmMmZiZjlhYTM4NTJlY2RmYmZjYzgwZGM0MTcyMDIzNjI5MzU4YWY2Njc3ZGE5NzVhMmE2N2FjZjVhYmQ5OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ymBTkeFHsSe0plm4en4ROWld1m-9w8UHjjufKSo7bNo)
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.