Skip to content

Commit 22b7b98

Browse files
update storage sdk to latest (#188)
* update storage sdk to latest (#182) Update run-e2e-tests-python310-lcon-msi.yaml * testing user-assigned and system-assigned MI log --------- Co-authored-by: Richard Lavey <6595659+rlaveycal@users.noreply.github.com>
1 parent 0db7cd7 commit 22b7b98

18 files changed

Lines changed: 1398 additions & 1755 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: RUN_E2E_TESTS_PYTHON310_LCON_MSI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- dev
7+
- releases/*
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
14+
permissions:
15+
id-token: write
16+
17+
env:
18+
AZURE_FUNCTIONAPP_NAME: gae-fa-python310-lcon-msi
19+
AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/python310'
20+
PYTHON_VERSION: '3.10'
21+
22+
jobs:
23+
run:
24+
name: Run E2E Tests
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Set Node.js 16.x for GitHub Action
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: 16.x
34+
35+
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
36+
uses: actions/setup-python@v1
37+
with:
38+
python-version: ${{ env.PYTHON_VERSION }}
39+
40+
- name: Run Npm Install for GitHub Action
41+
run: npm install
42+
43+
- name: Build GitHub Action
44+
run: npm run build
45+
46+
- name: E2E Resolve Project Dependencies Using Pip
47+
shell: bash
48+
run: |
49+
pushd '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
50+
python -m pip install --upgrade pip
51+
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
52+
echo "$GITHUB_SHA" > sha.txt
53+
popd
54+
55+
- name: 'Login via Azure CLI'
56+
uses: azure/login@v1
57+
with:
58+
client-id: ${{ secrets.AZURE_CLIENT_ID_FA_PYTHON310_LCON_MSI }}
59+
tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_PYTHON310_LCON_MSI }}
60+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_PYTHON310_LCON_MSI }}
61+
62+
- name: E2E Run Azure Functions Action
63+
uses: ./
64+
id: fa
65+
with:
66+
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
67+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
68+
69+
- name: E2E Check HttpTrigger Result
70+
shell: pwsh
71+
run: |
72+
$i = 0
73+
while ($i -lt 10) {
74+
sleep 10
75+
$RESPONSE = $(curl "${{ steps.fa.outputs.app-url }}/api/HttpTrigger")
76+
$RESULT = ($RESPONSE -eq "$env:GITHUB_SHA")
77+
if ($RESULT) {
78+
exit 0
79+
}
80+
$i = $i + 1
81+
}
82+
exit 1

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ Follow these steps to configure your workflow to use an [Azure Service Principal
9090

9191
Azure Functions GitHub Action is supported for the Azure public cloud as well as Azure government clouds ('AzureUSGovernment' or 'AzureChinaCloud') and Azure Stack ('AzureStack') Hub. Before running this action, login to the respective Azure Cloud using [Azure Login](https://github.com/Azure/login) by setting appropriate value for the `environment` parameter.
9292

93+
### Manged Identities for Storage Account Access and Package Deployments on Linux Consumption SKU
94+
95+
If the function app uses managed identities for accessing the storage account (i.e. `AzureWebJobsStorage` is not set) then the action will use the RBAC account to publish a package deployment to the storage account defined in `AzureWebJobsStorage__accountName`. The app setting `WEBSITE_RUN_FROM_PACKAGE` will be created during deployment and will not include a SAS token.
96+
97+
If `WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID` is defined then user-assigned manage identity will be used, otherwise system-assigned manage identity. The RBAC account will require [Microsoft.Storage/storageAccounts/listkeys/action](https://learn.microsoft.com/en-us/azure/storage/blobs/authorize-data-operations-portal#use-the-account-access-key) if `AzureWebJobsStorage` is not set.
98+
9399
## GitHub Action Parameters
94100
- **app-name**: The function app name on Azure. (e.g. if your function app can be accessed via https://your-site-name.azurewebsites.net/, then **app-name** should be `your-site-name`).
95101
- **package**: This is the location in your project to be published. By default, this value is set to `.`, which means all files and folders in the GitHub repository will be deployed.

action.yml

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
1-
# Azure Functions GitHub Action
2-
name: 'Azure Functions Action'
3-
description: 'Deploy Function App to Azure Functions'
4-
inputs:
5-
app-name:
6-
description: 'Name of the Azure Function App'
7-
required: true
8-
package:
9-
description: 'Path to package or folder. *.zip or a folder to deploy'
10-
required: false
11-
default: '.'
12-
slot-name:
13-
description: 'Function app slot to be deploy to'
14-
required: false
15-
publish-profile:
16-
description: 'Publish profile (*.publishsettings) file contents with web deploy secrets'
17-
required: false
18-
respect-pom-xml:
19-
description: "Automatically look up Java function app artifact from pom.xml (default: 'false').
20-
When this is set to 'true', 'package' should point to the folder of host.json."
21-
required: false
22-
default: 'false'
23-
respect-funcignore:
24-
description: "Remove unwanted files defined in .funcignore file (default: 'false').
25-
When this is set to 'true', 'package' should point to the folder of host.json."
26-
required: false
27-
default: 'false'
28-
scm-do-build-during-deployment:
29-
description: "Enable build action from Kudu when the package is deployed onto the function app.
30-
This will temporarily change the SCM_DO_BUILD_DURING_DEPLOYMENT setting for this deployment.
31-
To bypass this and use the existing settings from your function app, please set this to an empty
32-
string ''.
33-
To enable remote build for your project, please set this and 'enable-oryx-build' both to 'true'.
34-
By default, GitHub Action respects the packages resolved in GitHub workflow, disabling the
35-
redundant build action from Kudu endpoint. (default: 'false')."
36-
required: false
37-
default: 'false'
38-
enable-oryx-build:
39-
description: "Use Oryx Build from Kudu when the package is deployed onto the function app. (Linux functions only).
40-
This will temporarily change the ENABLE_ORYX_BUILD setting from this deployment.
41-
To bypass this and use the existing settings from your function app, please set this to an empty
42-
string ''.
43-
To enable remote build for your project, please set this and 'scm-do-build-during-deployment' both
44-
to 'true'.
45-
By default, GitHub Action respects the packages resolved in GitHub workflow, disabling the
46-
redundant build action from Kudu endpoint. (default: 'false')."
47-
required: false
48-
default: 'false'
49-
outputs:
50-
app-url:
51-
description: 'URL to work with your function app'
52-
branding:
53-
icon: 'functionapp.svg'
54-
color: 'blue'
55-
runs:
56-
using: 'node16'
57-
main: 'lib/main.js'
1+
# Azure Functions GitHub Action
2+
name: 'Azure Functions Action'
3+
description: 'Deploy Function App to Azure Functions'
4+
inputs:
5+
app-name:
6+
description: 'Name of the Azure Function App'
7+
required: true
8+
package:
9+
description: 'Path to package or folder. *.zip or a folder to deploy'
10+
required: false
11+
default: '.'
12+
slot-name:
13+
description: 'Function app slot to be deploy to'
14+
required: false
15+
publish-profile:
16+
description: 'Publish profile (*.publishsettings) file contents with web deploy secrets'
17+
required: false
18+
respect-pom-xml:
19+
description: "Automatically look up Java function app artifact from pom.xml (default: 'false').
20+
When this is set to 'true', 'package' should point to the folder of host.json."
21+
required: false
22+
default: 'false'
23+
respect-funcignore:
24+
description: "Remove unwanted files defined in .funcignore file (default: 'false').
25+
When this is set to 'true', 'package' should point to the folder of host.json."
26+
required: false
27+
default: 'false'
28+
scm-do-build-during-deployment:
29+
description: "Enable build action from Kudu when the package is deployed onto the function app.
30+
This will temporarily change the SCM_DO_BUILD_DURING_DEPLOYMENT setting for this deployment.
31+
To bypass this and use the existing settings from your function app, please set this to an empty
32+
string ''.
33+
To enable remote build for your project, please set this and 'enable-oryx-build' both to 'true'.
34+
By default, GitHub Action respects the packages resolved in GitHub workflow, disabling the
35+
redundant build action from Kudu endpoint. (default: 'false')."
36+
required: false
37+
default: 'false'
38+
enable-oryx-build:
39+
description: "Use Oryx Build from Kudu when the package is deployed onto the function app. (Linux functions only).
40+
This will temporarily change the ENABLE_ORYX_BUILD setting from this deployment.
41+
To bypass this and use the existing settings from your function app, please set this to an empty
42+
string ''.
43+
To enable remote build for your project, please set this and 'scm-do-build-during-deployment' both
44+
to 'true'.
45+
By default, GitHub Action respects the packages resolved in GitHub workflow, disabling the
46+
redundant build action from Kudu endpoint. (default: 'false')."
47+
required: false
48+
default: 'false'
49+
outputs:
50+
app-url:
51+
description: 'URL to work with your function app'
52+
package-url:
53+
description: 'URL to the package zip file if using package deployment'
54+
branding:
55+
icon: 'functionapp.svg'
56+
color: 'blue'
57+
runs:
58+
using: 'node16'
59+
main: 'lib/main.js'

0 commit comments

Comments
 (0)