When trying deploy an Azure Function via a pipeline, I'm seeing the following error -
✖ Could not get the resource group associated with function my-function-app.
I used a snippet from readme file of the azure-function-deploy pipeline in my YAML file, so hopefully I'm not missing anything. I'm using version 1.0.1.
Is anyone able to suggest what may be going wrong, or how I can further investigate the issue?
Here is my pipeline YAML file -
image: microsoft/dotnet:sdk
pipelines:
custom:
deploy:
- step:
name: Build WitchHunt
caches:
- dotnetcore
script:
- dotnet restore
- dotnet build $PROJECT_NAME
- apt-get update
- apt-get install zip -y
- zipfile="myapp.zip"
- dir="packages"
- mkdir $dir
- zip -r $zipfile $dir
- step:
name: Deploy Function App to Azure
script:
- pipe: microsoft/azure-functions-deploy:1.0.1
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
FUNCTION_APP_NAME: $FUNCTION_APP_NAME
ZIP_FILE: packages/myapp.zip
DEBUG: "false"
Hi @David Gard ,
It looks like you're not actually passing the artifact you built into the second step (the one with the pipe).
You'll need to change the yaml to
image: microsoft/dotnet:sdk
pipelines:
custom:
deploy:
- step:
name: Build WitchHunt
caches:
- dotnetcore
script:
- ...
artifacts:
- packages
- step:
name: Deploy Function App to Azure
script:
- pipe: microsoft/azure-functions-deploy:1.0.1
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
FUNCTION_APP_NAME: $FUNCTION_APP_NAME
ZIP_FILE: packages/myapp.zip
DEBUG: "false"
This will pass the folder with your application into the next step which will enable it to deploy.
Cheers,
Tom.
Hello @Tom Bradshaw
For some reason my question is on here twice, and I've already answered the other one.
I've also added the artefact (seems to be best practice), but I think my issue was down to issues with the azure-functions-deploy pipe.
Thanks,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.