Skip to content

Commit 0c25796

Browse files
Initialize Azure Functions project structure with necessary configuration files and scripts
1 parent 8d47082 commit 0c25796

File tree

12 files changed

+148
-11
lines changed

12 files changed

+148
-11
lines changed

.funcignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git*
2+
.vscode
3+
__azurite_db*__.json
4+
__blobstorage__
5+
__queuestorage__
6+
local.settings.json
7+
test

.github/workflows/main_githubapp.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ env:
1515
jobs:
1616
deploy:
1717
runs-on: ubuntu-latest
18-
permissions:
19-
id-token: write #This is required for requesting the JWT
20-
contents: read #This is required for actions/checkout
18+
permissions:
19+
id-token: write #This is required for requesting the JWT
20+
contents: read #This is required for actions/checkout
2121

2222
steps:
2323
- name: 'Checkout GitHub Action'
2424
uses: actions/checkout@v4
25-
26-
- name: Login to Azure
27-
uses: azure/login@v2
28-
with:
29-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_24C65484B1E34656B2DA01F06DD94E51 }}
30-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_25339433CE2E451E8B4EAE93D48870B0 }}
31-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_347192713AD646018D2785070041591F }}
25+
26+
- name: Login to Azure
27+
uses: azure/login@v2
28+
with:
29+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_24C65484B1E34656B2DA01F06DD94E51 }}
30+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_25339433CE2E451E8B4EAE93D48870B0 }}
31+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_347192713AD646018D2785070041591F }}
3232

3333
- name: 'Run Azure Functions Action'
3434
uses: Azure/functions-action@v1
@@ -37,4 +37,3 @@ jobs:
3737
app-name: 'githubapp'
3838
slot-name: 'Production'
3939
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
40-

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# Azure Functions artifacts
3+
bin
4+
obj
5+
appsettings.json
6+
local.settings.json
7+
8+
# Azurite artifacts
9+
__blobstorage__
10+
__queuestorage__
11+
__azurite_db*__.json

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"ms-azuretools.vscode-azurefunctions",
4+
"ms-vscode.PowerShell"
5+
]
6+
}

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to PowerShell Functions",
6+
"type": "PowerShell",
7+
"request": "attach",
8+
"customPipeName": "AzureFunctionsPSWorker",
9+
"runspaceId": 1,
10+
"preLaunchTask": "func: host start"
11+
}
12+
]
13+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"azureFunctions.deploySubpath": ".",
3+
"azureFunctions.projectLanguage": "PowerShell",
4+
"azureFunctions.projectRuntime": "~4"
5+
}

.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "func",
6+
"label": "func: host start",
7+
"command": "host start",
8+
"problemMatcher": "$func-powershell-watch",
9+
"isBackground": true
10+
}
11+
]
12+
}

host.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "2.0",
3+
"logging": {
4+
"applicationInsights": {
5+
"samplingSettings": {
6+
"isEnabled": true,
7+
"excludedTypes": "Request"
8+
}
9+
}
10+
},
11+
"extensionBundle": {
12+
"id": "Microsoft.Azure.Functions.ExtensionBundle"
13+
},
14+
"managedDependency": {
15+
"enabled": true
16+
}
17+
}

profile.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Azure Functions profile.ps1
2+
#
3+
# This profile.ps1 will get executed every "cold start" of your Function App.
4+
# "cold start" occurs when:
5+
#
6+
# * A Function App starts up for the very first time
7+
# * A Function App starts up after being de-allocated due to inactivity
8+
#
9+
# You can define helper functions, run commands, or specify environment variables
10+
# NOTE: any variables defined that are not environment variables will get reset after the first execution
11+
12+
# Authenticate with Azure PowerShell using MSI.
13+
# Remove this if you are not planning on using MSI or Azure PowerShell.
14+
if ($env:MSI_SECRET) {
15+
$null = Disable-AzContextAutosave -Scope Process
16+
Connect-AzAccount -Identity
17+
Connect-GitHub -ClientID 'Iv23liYDnEbKlS9IVzHf' -KeyVaultKeyReference 'https://psmodule-test-vault.vault.azure.net/keys/psmodule-org-app'
18+
}
19+
20+
# Uncomment the next line to enable legacy AzureRm alias in Azure PowerShell.
21+
# Enable-AzureRmAlias
22+
23+
# You can also define functions or aliases that can be referenced in any of your PowerShell functions.

requirements.psd1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file enables modules to be automatically managed by the Functions service.
2+
# See https://aka.ms/functionsmanageddependency for additional information.
3+
#
4+
@{
5+
# For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'. Uncomment the next line and replace the MAJOR_VERSION, e.g., 'Az' = '5.*'
6+
'Az' = '14.*'
7+
'GitHub' = '0.*'
8+
}

0 commit comments

Comments
 (0)