Skip to content

Commit 4cd6870

Browse files
authored
KEDA scaling using SAS (#20)
1 parent 1ef98bf commit 4cd6870

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ This repository contains a collection of patterns and best practices for buildin
2020
Before deploying, you must be authenticated to Azure and have the appropriate subscription selected. Run the following command to authenticate:
2121

2222
```shell
23-
az login --scope https://graph.microsoft.com//.default
23+
az login
24+
```
25+
26+
If you have multiple tenants, you can use the following command to log into the tenant:
27+
28+
```shell
29+
az login --tenant <tenant-id>
2430
```
2531

2632
Set the subscription to the one you want to use (you can use [az account list](https://learn.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-list) to list available subscriptions):
@@ -39,6 +45,12 @@ Use the next command to login with the Azure Dev CLI (AZD) tool:
3945
azd auth login
4046
```
4147

48+
If you have multiple tenants, you can use the following command to log into the tenant:
49+
50+
```pwsh
51+
azd auth login --tenant-id <tenant-id>
52+
```
53+
4254
## Create a new environment
4355

4456
Next we provide the AZD tool with variables that it uses to create the deployment. The first thing we initialize is the AZD environment with a name.

infra/shared/terraform/modules/postresql/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ resource "azurerm_postgresql_flexible_server" "postgresql_database" {
6363

6464
content {
6565
mode = "ZoneRedundant"
66-
standby_availability_zone = 2
6766
}
6867
}
6968

70-
zone = 1
7169
storage_mb = 32768
7270

7371
create_mode = var.source_server_id != null ? "Replica" : null
@@ -85,6 +83,13 @@ resource "azurerm_postgresql_flexible_server" "postgresql_database" {
8583
"application-name" = var.application_name
8684
}
8785

86+
lifecycle {
87+
ignore_changes = [
88+
zone,
89+
high_availability.0.standby_availability_zone
90+
]
91+
}
92+
8893
depends_on = [azurerm_private_dns_zone_virtual_network_link.postgresql_database]
8994
}
9095

infra/shared/terraform/modules/service-bus/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ resource "azurerm_servicebus_namespace" "servicebus_namespace" {
2626
capacity = var.environment == "prod" ? var.capacity : 0
2727
premium_messaging_partitions = var.environment == "prod" ? 1 : 0
2828
# Should be set to false, but we need it for Keda scaling rules
29-
# https://github.com/microsoft/azure-container-apps/issues/592
30-
local_auth_enabled = false
29+
# https://github.com/hashicorp/terraform-provider-azurerm/issues/26570
30+
local_auth_enabled = true
3131

3232
zone_redundant = var.environment == "prod" ? true : false
3333

0 commit comments

Comments
 (0)