Skip to content

Commit 09e8ce6

Browse files
committed
Deploy Function using SP
1 parent 2193acb commit 09e8ce6

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.github/workflows/_functionAppDeployTemplate.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,18 @@ on:
2222
type: string
2323
description: "Specifies the name of the Azure Function."
2424
secrets:
25-
FUNCTION_PUBLISH_PROFILE:
25+
TENANT_ID:
2626
required: true
27-
description: "Specifies the publish profile of the function."
27+
description: "Specifies the tenant id of the deployment."
28+
CLIENT_ID:
29+
required: true
30+
description: "Specifies the client id."
31+
CLIENT_SECRET:
32+
required: true
33+
description: "Specifies the client secret."
34+
SUBSCRIPTION_ID:
35+
required: true
36+
description: "Specifies the client id."
2837

2938
jobs:
3039
deployment:
@@ -56,13 +65,20 @@ jobs:
5665
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
5766
popd
5867
68+
# Login to Azure
69+
- name: Azure Login
70+
id: azure_login
71+
uses: azure/login@v1
72+
with:
73+
creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}'
74+
5975
# Deploy Function
6076
- name: Deploy Function
6177
id: function_deploy
6278
uses: Azure/functions-action@v1
6379
with:
6480
app-name: ${{ inputs.function_name }}
6581
package: ${{ inputs.function_directory }}
66-
publish-profile: ${{ secrets.FUNCTION_PUBLISH_PROFILE }}
82+
# publish-profile: ${{ secrets.FUNCTION_PUBLISH_PROFILE }}
6783
scm-do-build-during-deployment: true
6884
enable-oryx-build: true

.github/workflows/functionApp.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ jobs:
3131
function_directory: "./code/function"
3232
function_name: "myfunc-dev-fctn001"
3333
secrets:
34-
FUNCTION_PUBLISH_PROFILE: ${{ secrets.FUNCTION_PUBLISH_PROFILE }}
34+
TENANT_ID: ${{ secrets.TENANT_ID }}
35+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
36+
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
37+
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}

.github/workflows/terraform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: ./.github/workflows/_terraformApplyTemplate.yml
3939
name: "Terraform Apply"
4040
needs: [terraform_plan_dev]
41-
# if: github.event_name == 'push' || github.event_name == 'release'
41+
if: github.event_name == 'push' || github.event_name == 'release'
4242
with:
4343
environment: "dev"
4444
terraform_version: "1.4.6"

__azurite_db_table__.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"filename":"c:\\Users\\mabuss\\source\\repos\\PerfectThymeTech\\AzureFunctionPython\\__azurite_db_table__.json","collections":[{"name":"$TABLES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"account":{"name":"account","dirty":false,"values":[]},"table":{"name":"table","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$TABLES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}

0 commit comments

Comments
 (0)