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: samples/function-app-managed-identity/python/terraform/README.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,25 @@ The [deploy.sh](deploy.sh) script executes the following steps:
56
56
57
57
## Configuration
58
58
59
-
Before deploying the Terraform modules, update the `terraform.tfvars` file with your specific values:
59
+
When using LocalStack for Azure, configure the `metadata_host` and `subscription_id` settings in the [Azure Provider for Terraform](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) to ensure proper connectivity:
60
+
60
61
61
62
```hcl
62
-
location = "westeurope"
63
-
python_version = "3.13"
63
+
provider "azurerm" {
64
+
features {
65
+
resource_group {
66
+
prevent_deletion_if_contains_resources = false
67
+
}
68
+
}
69
+
70
+
# Set the hostname of the Azure Metadata Service (for example management.azure.com)
71
+
# used to obtain the Cloud Environment when using LocalStack's Azure emulator.
72
+
# This allows the provider to correctly identify the environment and avoid making calls to the real Azure endpoints.
73
+
metadata_host="localhost.localstack.cloud:4566"
74
+
75
+
# Set the subscription ID to a dummy value when using LocalStack's Azure emulator.
echo"[DEBUG] Checking what tflocal does..."echo "[DEBUG] tflocal version: $($TERRAFORM version 2>&1| head -1)"echo "[DEBUG] Contents of current directory before init:"ls -la .2>&1| head -20
Copy file name to clipboardExpand all lines: samples/function-app-storage-http/dotnet/terraform/README.md
+44-21Lines changed: 44 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,38 +49,61 @@ See [deploy.sh](deploy.sh) for the complete deployment automation. The script pe
49
49
- Creates deployment zip package from published output
50
50
- Deploys the zip to Azure Function App using Azure CLI
51
51
52
+
## Configuration
53
+
54
+
When using LocalStack for Azure, configure the `metadata_host` and `subscription_id` settings in the [Azure Provider for Terraform](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) to ensure proper connectivity:
55
+
56
+
57
+
```hcl
58
+
provider "azurerm" {
59
+
features {
60
+
resource_group {
61
+
prevent_deletion_if_contains_resources = false
62
+
}
63
+
}
64
+
65
+
# Set the hostname of the Azure Metadata Service (for example management.azure.com)
66
+
# used to obtain the Cloud Environment when using LocalStack's Azure emulator.
67
+
# This allows the provider to correctly identify the environment and avoid making calls to the real Azure endpoints.
68
+
metadata_host="localhost.localstack.cloud:4566"
69
+
70
+
# Set the subscription ID to a dummy value when using LocalStack's Azure emulator.
1.You can set up the Azure emulator by utilizing LocalStack for Azure Docker image. Before starting, ensure you have a valid `LOCALSTACK_AUTH_TOKEN` to access the Azure emulator. Refer to the [Auth Token guide](https://docs.localstack.cloud/getting-started/auth-token/?__hstc=108988063.8aad2b1a7229945859f4d9b9bb71e05d.1743148429561.1758793541854.1758810151462.32&__hssc=108988063.3.1758810151462&__hsfp=3945774529) to obtain your Auth Token and specify it in the `LOCALSTACK_AUTH_TOKEN` environment variable. The Azure Docker image is available on the [LocalStack Docker Hub](https://hub.docker.com/r/localstack/localstack-azure-alpha). To pull the Azure Docker image, execute the following command:
77
+
You can set up the Azure emulator by utilizing LocalStack for Azure Docker image. Before starting, ensure you have a valid `LOCALSTACK_AUTH_TOKEN` to access the Azure emulator. Refer to the [Auth Token guide](https://docs.localstack.cloud/getting-started/auth-token/?__hstc=108988063.8aad2b1a7229945859f4d9b9bb71e05d.1743148429561.1758793541854.1758810151462.32&__hssc=108988063.3.1758810151462&__hsfp=3945774529) to obtain your Auth Token and specify it in the `LOCALSTACK_AUTH_TOKEN` environment variable. The Azure Docker image is available on the [LocalStack Docker Hub](https://hub.docker.com/r/localstack/localstack-azure-alpha). To pull the Azure Docker image, execute the following command:
55
78
56
-
```bash
57
-
docker pull localstack/localstack-azure-alpha
58
-
```
79
+
```bash
80
+
docker pull localstack/localstack-azure-alpha
81
+
```
59
82
60
-
2.Start the LocalStack Azure emulator using the localstack CLI, execute the following command:
83
+
Start the LocalStack Azure emulator using the localstack CLI, execute the following command:
echo"[DEBUG] Checking what tflocal does..."echo "[DEBUG] tflocal version: $($TERRAFORM version 2>&1| head -1)"echo "[DEBUG] Contents of current directory before init:"ls -la .2>&1| head -20
0 commit comments