I solved my issue.
mistake was on pipeline lvl
I just remove cd src/functions .
Function App not showing up on list of functions after deployment from gitlab pipeline
Jarosław Skoczeń
0
Reputation points
I prepared Gitlab pipeline to publish azure function.
stages:
- publish
image: mcr.microsoft.com/azure-functions/node:4-node18-core-tools
.publish:
stage: publish
script:
- npm install @azure/functions
- az login --service-principal -u $AZURE_CLIENT_ID --federated-token `cat $AZURE_FEDERATED_TOKEN_FILE` --tenant $AZURE_TENANT_ID
- cd src/functions
- |
echo '{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
}
}' > local.settings.json
- npm run build
- func azure functionapp publish example-functions-acc
Unfortunatelly pipeline working correctly, no errors.
But function App not showing up on list after deployment.
pipeline log:
$ npm install @azure/functions
added 48 packages, and audited 49 packages in 2s
14 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ az login --service-principal -u $AZURE_CLIENT_ID --federated-token `cat $AZURE_FEDERATED_TOKEN_FILE` --tenant $AZURE_TENANT_ID
[
{
"cloudName": "AzureCloud",
"homeTenantId": "6246c9fe-79e6-4621-bcc2-xxxx",
"id": "c606ee86-7f71-4aa3-be45-xxxx",
"isDefault": true,
"managedByTenants": [],
"name": "Example - Acceptance",
"state": "Enabled",
"tenantId": "6246c9fe-79e6-4621-bcc2-xxx",
"user": {
"name": "d63551ed-959a-4b9d-90ff-xxx",
"type": "servicePrincipal"
}
}
]
$ cd src/functions
$ echo '{ # collapsed multi-line command
$ npm run build
> exampletaskrunner@1.0.0 build
> tsc
$ func azure functionapp publish example-functions-acc
Getting site publishing info...
Uploading package...
Uploading 534 B []
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in example-functions-acc:
Cleaning up project directory and file based variables
00:00
Job succeeded
az functionapp function list --resource-group rg-example-acceptance --name example-functions-acc
[]
I have existing function, which developer delivered.
When he deploys by IDE VSCode I see on the list.
Problem is with pipeline.
Do you have any ideas?
I am not familiar with TypeScript pipeline.
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
1 answer
Sort by: Most helpful
-
Jarosław Skoczeń 0 Reputation points
2024-01-16T15:24:04.1666667+00:00