diff --git a/.github/workflows/run-samples.yml b/.github/workflows/run-samples.yml index e5dae8a..458dd37 100644 --- a/.github/workflows/run-samples.yml +++ b/.github/workflows/run-samples.yml @@ -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 diff --git a/samples/function-app-managed-identity/python/bicep/README.md b/samples/function-app-managed-identity/python/bicep/README.md index b2e2883..79c8740 100644 --- a/samples/function-app-managed-identity/python/bicep/README.md +++ b/samples/function-app-managed-identity/python/bicep/README.md @@ -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 diff --git a/samples/function-app-managed-identity/python/bicep/deploy.sh b/samples/function-app-managed-identity/python/bicep/deploy.sh index d4e88f8..9773b08 100755 --- a/samples/function-app-managed-identity/python/bicep/deploy.sh +++ b/samples/function-app-managed-identity/python/bicep/deploy.sh @@ -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 diff --git a/samples/function-app-managed-identity/python/scripts/README.md b/samples/function-app-managed-identity/python/scripts/README.md index fa0373c..f7440c4 100644 --- a/samples/function-app-managed-identity/python/scripts/README.md +++ b/samples/function-app-managed-identity/python/scripts/README.md @@ -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 diff --git a/samples/function-app-managed-identity/python/scripts/system-managed-identity.sh b/samples/function-app-managed-identity/python/scripts/system-managed-identity.sh index dcfa0f1..dd04639 100755 --- a/samples/function-app-managed-identity/python/scripts/system-managed-identity.sh +++ b/samples/function-app-managed-identity/python/scripts/system-managed-identity.sh @@ -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" diff --git a/samples/function-app-managed-identity/python/scripts/user-managed-identity.sh b/samples/function-app-managed-identity/python/scripts/user-managed-identity.sh index 3380099..6432874 100755 --- a/samples/function-app-managed-identity/python/scripts/user-managed-identity.sh +++ b/samples/function-app-managed-identity/python/scripts/user-managed-identity.sh @@ -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" diff --git a/samples/function-app-managed-identity/python/scripts/validate.sh b/samples/function-app-managed-identity/python/scripts/validate.sh old mode 100644 new mode 100755 index 6859574..4b9dd3e --- a/samples/function-app-managed-identity/python/scripts/validate.sh +++ b/samples/function-app-managed-identity/python/scripts/validate.sh @@ -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 \ No newline at end of file + --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 diff --git a/samples/function-app-managed-identity/python/terraform/README.md b/samples/function-app-managed-identity/python/terraform/README.md index 91ac945..b65526f 100644 --- a/samples/function-app-managed-identity/python/terraform/README.md +++ b/samples/function-app-managed-identity/python/terraform/README.md @@ -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 diff --git a/samples/function-app-managed-identity/python/terraform/terraform.tfvars b/samples/function-app-managed-identity/python/terraform/terraform.tfvars index 1c1a433..d556b60 100644 --- a/samples/function-app-managed-identity/python/terraform/terraform.tfvars +++ b/samples/function-app-managed-identity/python/terraform/terraform.tfvars @@ -1,3 +1,3 @@ location = "westeurope" runtime_name = "python" -python_version = "3.12" \ No newline at end of file +python_version = "3.13" \ No newline at end of file diff --git a/samples/function-app-managed-identity/python/terraform/variables.tf b/samples/function-app-managed-identity/python/terraform/variables.tf index ca77a68..3224ed7 100644 --- a/samples/function-app-managed-identity/python/terraform/variables.tf +++ b/samples/function-app-managed-identity/python/terraform/variables.tf @@ -181,6 +181,8 @@ variable "python_version" { validation { condition = contains([ + "3.14", + "3.13", "3.12", "3.11", "3.10", diff --git a/samples/web-app-managed-identity/python/bicep/README.md b/samples/web-app-managed-identity/python/bicep/README.md index 9b4ee5e..9ba83a0 100644 --- a/samples/web-app-managed-identity/python/bicep/README.md +++ b/samples/web-app-managed-identity/python/bicep/README.md @@ -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}" diff --git a/samples/web-app-managed-identity/python/bicep/deploy.sh b/samples/web-app-managed-identity/python/bicep/deploy.sh index 9b5e148..149e131 100755 --- a/samples/web-app-managed-identity/python/bicep/deploy.sh +++ b/samples/web-app-managed-identity/python/bicep/deploy.sh @@ -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 diff --git a/samples/web-app-managed-identity/python/scripts/README.md b/samples/web-app-managed-identity/python/scripts/README.md index 502feda..fe2aab9 100644 --- a/samples/web-app-managed-identity/python/scripts/README.md +++ b/samples/web-app-managed-identity/python/scripts/README.md @@ -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}" diff --git a/samples/web-app-managed-identity/python/scripts/call-web-app.sh b/samples/web-app-managed-identity/python/scripts/call-web-app.sh old mode 100644 new mode 100755 diff --git a/samples/web-app-managed-identity/python/scripts/system-assigned.sh b/samples/web-app-managed-identity/python/scripts/system-assigned.sh index fc926ed..2850aa8 100755 --- a/samples/web-app-managed-identity/python/scripts/system-assigned.sh +++ b/samples/web-app-managed-identity/python/scripts/system-assigned.sh @@ -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' diff --git a/samples/web-app-managed-identity/python/scripts/user-assigned.sh b/samples/web-app-managed-identity/python/scripts/user-assigned.sh index 9ae868a..c688671 100755 --- a/samples/web-app-managed-identity/python/scripts/user-assigned.sh +++ b/samples/web-app-managed-identity/python/scripts/user-assigned.sh @@ -9,7 +9,7 @@ APP_SERVICE_PLAN_NAME="${PREFIX}-app-service-plan-${SUFFIX}" APP_SERVICE_PLAN_SKU="B1" MANAGED_IDENTITY_NAME="${PREFIX}-identity-${SUFFIX}" 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' diff --git a/samples/web-app-managed-identity/python/scripts/validate.sh b/samples/web-app-managed-identity/python/scripts/validate.sh old mode 100644 new mode 100755 index e97ab1f..67198f8 --- a/samples/web-app-managed-identity/python/scripts/validate.sh +++ b/samples/web-app-managed-identity/python/scripts/validate.sh @@ -3,7 +3,7 @@ # 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}" diff --git a/samples/web-app-managed-identity/python/terraform/README.md b/samples/web-app-managed-identity/python/terraform/README.md index afd926a..3aff1a3 100644 --- a/samples/web-app-managed-identity/python/terraform/README.md +++ b/samples/web-app-managed-identity/python/terraform/README.md @@ -122,7 +122,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}" diff --git a/samples/web-app-managed-identity/python/terraform/deploy.sh b/samples/web-app-managed-identity/python/terraform/deploy.sh index 16441f6..4647b3f 100755 --- a/samples/web-app-managed-identity/python/terraform/deploy.sh +++ b/samples/web-app-managed-identity/python/terraform/deploy.sh @@ -4,7 +4,7 @@ PREFIX='local' SUFFIX='test' LOCATION='westeurope' -MANAGED_IDENTITY_TYPE='SystemAssigned' # SystemAssigned or UserAssigned +MANAGED_IDENTITY_TYPE='UserAssigned' # SystemAssigned or UserAssigned CURRENT_DIR="$(cd "$(dirname "$0")" && pwd)" ZIPFILE="planner_website.zip" diff --git a/samples/web-app-managed-identity/python/terraform/providers.tf b/samples/web-app-managed-identity/python/terraform/providers.tf index c1be151..25af634 100644 --- a/samples/web-app-managed-identity/python/terraform/providers.tf +++ b/samples/web-app-managed-identity/python/terraform/providers.tf @@ -19,7 +19,7 @@ provider "azurerm" { # Set the hostname of the Azure Metadata Service (for example management.azure.com) # used to obtain the Cloud Environment when using LocalStack's Azure emulator. # This allows the provider to correctly identify the environment and avoid making calls to the real Azure endpoints. - metadata_host="localhost.localstack.cloud:4566" + metadata_host = "localhost.localstack.cloud:4566" # Set the subscription ID to a dummy value when using LocalStack's Azure emulator. subscription_id = "00000000-0000-0000-0000-000000000000" diff --git a/samples/web-app-managed-identity/python/terraform/terraform.tfvars b/samples/web-app-managed-identity/python/terraform/terraform.tfvars index 62c676a..8e831cf 100644 --- a/samples/web-app-managed-identity/python/terraform/terraform.tfvars +++ b/samples/web-app-managed-identity/python/terraform/terraform.tfvars @@ -1,2 +1,2 @@ location = "westeurope" -python_version = "3.12" \ No newline at end of file +python_version = "3.13" \ No newline at end of file diff --git a/samples/web-app-managed-identity/python/terraform/variables.tf b/samples/web-app-managed-identity/python/terraform/variables.tf index b989091..3f6fe30 100644 --- a/samples/web-app-managed-identity/python/terraform/variables.tf +++ b/samples/web-app-managed-identity/python/terraform/variables.tf @@ -151,6 +151,8 @@ variable "python_version" { validation { condition = contains([ + "3.14", + "3.13", "3.12", "3.11", "3.10",