Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ jobs:
sudo apt-get install -y jq zip unixodbc-dev libsnappy-dev default-mysql-client postgresql-client
find . -name "*.sh" -exec chmod +x {} +

- name: Pin Azure CLI to 2.88.0
- name: Install Azure CLI
# SHORTCUT: runner image ubuntu22/20260810.260 bumped the preinstalled az to
# 2.89.0, whose `az mysql flexible-server firewall-rule create` payload the
# emulator answers with a 500 (AttributeError on a None `properties` in
# mysql_flexible/apis/firewall_rules.py). Remove this pin once the released
# emulator image parses the az 2.89 request shape. Both runner arches are
# jammy, so one version string covers amd64 and arm64.
run: sudo apt-get install -y --allow-downgrades azure-cli=2.88.0-1~jammy
run: sudo apt-get install -y --allow-downgrades azure-cli

- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
Expand Down
62 changes: 41 additions & 21 deletions samples/function-app-managed-identity/python/bicep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,53 @@ After deployment, you can use the `validate.sh` script to verify that all resour
#!/bin/bash

# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"

# Check resource group
echo -e "[$RESOURCE_GROUP_NAME] resource group:\n"
az group show \
--name local-rg \
--output table

# List resources
az resource list \
--resource-group local-rg \
--output table

# Check function app status
az functionapp show \
--name local-func-test \
--resource-group local-rg \
--output table

# Check storage account properties
--name "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors

# Check Azure Function App
echo -e "\n[$FUNCTION_APP_NAME] function app:\n"
az functionapp show \
--name "$FUNCTION_APP_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,State:state,Location:location,DefaultHostName:defaultHostName}' \
--output table \
--only-show-errors

# Check storage account
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage account:\n"
az storage account show \
--name localstoragetest \
--resource-group local-rg \
--output table
--name "$STORAGE_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,Location:location,ResourceGroup:resourceGroup,Kind:kind,Sku:sku.name}' \
--output table \
--only-show-errors

# List storage containers
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage containers:\n"
az storage container list \
--account-name localstoragetest \
--output table \
--only-show-errors
--account-name "$STORAGE_ACCOUNT_NAME" \
--output table \
--only-show-errors

# List resources
echo -e "\n[$RESOURCE_GROUP_NAME] all resources:\n"
az resource list \
--resource-group "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors
```

## Cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREFIX='local'
SUFFIX='test'
TEMPLATE="main.bicep"
PARAMETERS="main.bicepparam"
RESOURCE_GROUP_NAME="$PREFIX-func-mi-rg"
RESOURCE_GROUP_NAME="$PREFIX-rg"
LOCATION="westeurope"
MANAGED_IDENTITY_TYPE='UserAssigned' # SystemAssigned or UserAssigned
VALIDATE_TEMPLATE=1
Expand Down
62 changes: 41 additions & 21 deletions samples/function-app-managed-identity/python/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,53 @@ After deployment, you can use the `validate.sh` script to verify that all resour
#!/bin/bash

# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"

# Check resource group
echo -e "[$RESOURCE_GROUP_NAME] resource group:\n"
az group show \
--name local-rg \
--output table

# List resources
az resource list \
--resource-group local-rg \
--output table

# Check function app status
az functionapp show \
--name local-func-test \
--resource-group local-rg \
--output table

# Check storage account properties
--name "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors

# Check Azure Function App
echo -e "\n[$FUNCTION_APP_NAME] function app:\n"
az functionapp show \
--name "$FUNCTION_APP_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,State:state,Location:location,DefaultHostName:defaultHostName}' \
--output table \
--only-show-errors

# Check storage account
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage account:\n"
az storage account show \
--name localstoragetest \
--resource-group local-rg \
--output table
--name "$STORAGE_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,Location:location,ResourceGroup:resourceGroup,Kind:kind,Sku:sku.name}' \
--output table \
--only-show-errors

# List storage containers
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage containers:\n"
az storage container list \
--account-name localstoragetest \
--output table \
--only-show-errors
--account-name "$STORAGE_ACCOUNT_NAME" \
--output table \
--only-show-errors

# List resources
echo -e "\n[$RESOURCE_GROUP_NAME] all resources:\n"
az resource list \
--resource-group "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors
```

## Cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"
RESOURCE_GROUP_NAME="${PREFIX}-rg"
RUNTIME="python"
RUNTIME_VERSION="3.12"
RUNTIME_VERSION="3.13"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
ZIPFILE="function_app.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MANAGED_IDENTITY_NAME="${PREFIX}-identity-${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"
RESOURCE_GROUP_NAME="${PREFIX}-rg"
RUNTIME="python"
RUNTIME_VERSION="3.12"
RUNTIME_VERSION="3.13"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
ZIPFILE="function_app.zip"
Expand Down
58 changes: 39 additions & 19 deletions samples/function-app-managed-identity/python/scripts/validate.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
#!/bin/bash

# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"

# Check resource group
echo -e "[$RESOURCE_GROUP_NAME] resource group:\n"
az group show \
--name local-rg \
--output table

# List resources
az resource list \
--resource-group local-rg \
--output table
--name "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors

# Check function app status
az functionapp show \
--name local-func-test \
--resource-group local-rg \
--output table
# Check Azure Function App
echo -e "\n[$FUNCTION_APP_NAME] function app:\n"
az functionapp show \
--name "$FUNCTION_APP_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,State:state,Location:location,DefaultHostName:defaultHostName}' \
--output table \
--only-show-errors

# Check storage account properties
# Check storage account
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage account:\n"
az storage account show \
--name localstoragetest \
--resource-group local-rg \
--output table
--name "$STORAGE_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,Location:location,ResourceGroup:resourceGroup,Kind:kind,Sku:sku.name}' \
--output table \
--only-show-errors

# List storage containers
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage containers:\n"
az storage container list \
--account-name localstoragetest \
--output table \
--only-show-errors
--account-name "$STORAGE_ACCOUNT_NAME" \
--output table \
--only-show-errors

# List resources
echo -e "\n[$RESOURCE_GROUP_NAME] all resources:\n"
az resource list \
--resource-group "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors
62 changes: 41 additions & 21 deletions samples/function-app-managed-identity/python/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,33 +131,53 @@ After deployment, you can use the `validate.sh` script to verify that all resour
#!/bin/bash

# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
INPUT_STORAGE_CONTAINER_NAME='input'
OUTPUT_STORAGE_CONTAINER_NAME='output'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
FUNCTION_APP_NAME="${PREFIX}-functionapp-${SUFFIX}"

# Check resource group
echo -e "[$RESOURCE_GROUP_NAME] resource group:\n"
az group show \
--name local-rg \
--output table

# List resources
az resource list \
--resource-group local-rg \
--output table

# Check function app status
az functionapp show \
--name local-func-test \
--resource-group local-rg \
--output table

# Check storage account properties
--name "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors

# Check Azure Function App
echo -e "\n[$FUNCTION_APP_NAME] function app:\n"
az functionapp show \
--name "$FUNCTION_APP_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,State:state,Location:location,DefaultHostName:defaultHostName}' \
--output table \
--only-show-errors

# Check storage account
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage account:\n"
az storage account show \
--name localstoragetest \
--resource-group local-rg \
--output table
--name "$STORAGE_ACCOUNT_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--query '{Name:name,Location:location,ResourceGroup:resourceGroup,Kind:kind,Sku:sku.name}' \
--output table \
--only-show-errors

# List storage containers
echo -e "\n[$STORAGE_ACCOUNT_NAME] storage containers:\n"
az storage container list \
--account-name localstoragetest \
--output table \
--only-show-errors
--account-name "$STORAGE_ACCOUNT_NAME" \
--output table \
--only-show-errors

# List resources
echo -e "\n[$RESOURCE_GROUP_NAME] all resources:\n"
az resource list \
--resource-group "$RESOURCE_GROUP_NAME" \
--output table \
--only-show-errors
```

## Cleanup
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
location = "westeurope"
runtime_name = "python"
python_version = "3.12"
python_version = "3.13"
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ variable "python_version" {

validation {
condition = contains([
"3.14",
"3.13",
"3.12",
"3.11",
"3.10",
Expand Down
2 changes: 1 addition & 1 deletion samples/web-app-managed-identity/python/bicep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ After deployment, you can use the `validate.sh` script to verify that all resour
# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-web-app-rg"
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
CONTAINER_NAME='activities'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
Expand Down
2 changes: 1 addition & 1 deletion samples/web-app-managed-identity/python/bicep/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREFIX='local'
SUFFIX='test'
TEMPLATE="main.bicep"
PARAMETERS="main.bicepparam"
RESOURCE_GROUP_NAME="$PREFIX-webapp-mi-rg"
RESOURCE_GROUP_NAME="$PREFIX-rg"
LOCATION="westeurope"
VALIDATE_TEMPLATE=1
USE_WHAT_IF=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ After deployment, you can use the `validate.sh` script to verify that all resour
# Variables
PREFIX='local'
SUFFIX='test'
RESOURCE_GROUP_NAME="${PREFIX}-web-app-rg"
RESOURCE_GROUP_NAME="${PREFIX}-rg"
STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
CONTAINER_NAME='activities'
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ STORAGE_ACCOUNT_NAME="${PREFIX}storage${SUFFIX}"
APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}"
APP_SERVICE_PLAN_SKU="B1"
WEB_APP_NAME="${PREFIX}-webapp-${SUFFIX}"
RESOURCE_GROUP_NAME="${PREFIX}-web-app-rg"
RESOURCE_GROUP_NAME="${PREFIX}-rg"
RUNTIME="python"
RUNTIME_VERSION="3.13"
CONTAINER_NAME='activities'
Expand Down
Loading
Loading