Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rrichley authored Dec 30, 2024
1 parent 2690ba9 commit 36aeead
Showing 1 changed file with 12 additions and 33 deletions.
45 changes: 12 additions & 33 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Azure Resources
name: Deploy Azure Storage Account with Log Analytics Integration

on:
push:
Expand All @@ -18,42 +18,21 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Create Resource Group
- name: Ensure Resource Group Exists
run: |
az group create --name rrblobtest --location "UK South"
if ! az group show --name rrblobtest &>/dev/null; then
az group create --name rrblobtest --location "UK West"
else
echo "Resource group rrblobtest already exists."
fi
- name: Deploy Storage Account
- name: Deploy Storage Account and Log Analytics Association
run: |
az deployment group create \
--resource-group rrblobtest \
--template-file bicep/storage-account.bicep \
--parameters location="UK South" \
--template-file bicep/main.bicep \
--parameters location="UK West" \
storageAccountName="test123434" \
containerName="images" \
allowedIP="92.16.42.251"
- name: Ensure Resource Group Exists
run: |
if ! az group show --name rrblobtest &>/dev/null; then
az group create --name rrblobtest --location "UK West"
else
echo "Resource group rrblobtest already exists."
fi
- name: Fetch Log Analytics Workspace ID
id: fetch_workspace_id
run: |
LOG_ANALYTICS_WORKSPACE_ID=$(az monitor log-analytics workspace show \
--resource-group <log-analytics-resource-group> \
--workspace-name rrlogtest \
--query id -o tsv)
echo "LOG_ANALYTICS_WORKSPACE_ID=${LOG_ANALYTICS_WORKSPACE_ID}" >> $GITHUB_ENV
- name: Deploy Log Analytics Integration
run: |
az deployment group create \
--resource-group rrblobtest \
--template-file bicep/log-analytics-integration.bicep \
--parameters storageAccountId="/subscriptions/<subscription-id>/resourceGroups/rrblobtest/providers/Microsoft.Storage/storageAccounts/test123434" \
logAnalyticsWorkspaceId="$LOG_ANALYTICS_WORKSPACE_ID"
allowedIP="92.16.42.251" \
logAnalyticsWorkspaceName="rrlogtest"

0 comments on commit 36aeead

Please sign in to comment.