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
11 changes: 3 additions & 8 deletions .bicep/logicapps/connection.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,8 @@ resource connection 'Microsoft.Web/connections@2016-06-01' = {
}
}

// Reference the existing access policy
resource existingConnectionPolicy 'Microsoft.Web/connections/accessPolicies@2016-06-01' existing = {
parent: connection
name: logicAppName
}

// Create access policy for the connection only if it doesn't already exist
resource ConnectionPolicy 'Microsoft.Web/connections/accessPolicies@2016-06-01' = if(existingConnectionPolicy == null) {
// Create access policy for the connection (will create or update if already exists)
resource ConnectionPolicy 'Microsoft.Web/connections/accessPolicies@2016-06-01' = {
parent: connection
name: logicAppName
location: location
Expand Down Expand Up @@ -72,6 +66,7 @@ resource connectionTags 'Microsoft.Resources/tags@2022-09-01' = {
}

// Return the connection runtime URL, this needs to be set in the connection JSON file later
#disable-next-line use-resource-symbol-reference
output connectionRuntimeUrl string = reference(connection.id, connection.apiVersion, 'full').properties.connectionRuntimeUrl
output api string = subscriptionResourceId('Microsoft.Web/locations/managedApis', location, 'azurequeues')
output id string = connection.id
Expand Down
34 changes: 32 additions & 2 deletions .bicep/logicapps/upload_workflows.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
#!/bin/bash
set -e # Exit on error

# Verify Azure login
echo "Verifying Azure login..."
az account show > /dev/null 2>&1 || { echo "ERROR: Not logged into Azure CLI"; exit 1; }
echo "Azure login verified."

# GET ACCESS KEY
ACCOUNT_KEY=$(az storage account keys list -n $1 --query '[].value' -o tsv)
echo "Retrieving storage account key..."
ACCOUNT_KEY=$(az storage account keys list -n "$1" --query '[0].value' -o tsv 2>&1)

if [ -z "$ACCOUNT_KEY" ] || [[ "$ACCOUNT_KEY" == *"ERROR"* ]]; then
echo "ERROR: Failed to retrieve storage account key for $1"
echo "Output: $ACCOUNT_KEY"
exit 1
fi

echo "Storage account key retrieved successfully."

# UPLOAD ALL FILES INSIDE OF WORKFLOWS FOLDER
az storage file upload-batch --destination $2 --source $3 --account-name $1 --account-key "$ACCOUNT_KEY"
echo "Uploading workflows from $3 to $2..."
az storage file upload-batch --destination "$2" --source "$3" --account-name "$1" --account-key "$ACCOUNT_KEY" 2>&1 || {
echo "ERROR: Upload failed. Trying with connection string instead..."
# Try alternate method using connection string
CONNECTION_STRING=$(az storage account show-connection-string -n "$1" --query connectionString -o tsv 2>&1)
if [ $? -eq 0 ]; then
az storage file upload-batch --destination "$2" --source "$3" --connection-string "$CONNECTION_STRING"
else
echo "ERROR: Both upload methods failed"
exit 1
fi
}

echo "Upload completed successfully."
2 changes: 1 addition & 1 deletion .github/workflows/setup-logicapp-resource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Upload Logic App Workflows
uses: azure/CLI@v1
with:
azcliversion: 2.44.1
azcliversion: 2.81.0
inlineScript: |
chmod +x ./.bicep/logicapps/upload_workflows.sh
./.bicep/logicapps/upload_workflows.sh ${{needs.setup-logic-app-resource.outputs.accountName}} ${{needs.setup-logic-app-resource.outputs.destination}} ./.bicep/logicapps/workflows
Expand Down
Binary file removed src/goapp/__debug_bin1553489815
Binary file not shown.
Binary file removed src/goapp/__debug_bin571931451
Binary file not shown.
Loading