Pipeline 'azure-functions-deploy' failing because it can't find resource group

David Gard
Contributor
April 12, 2019

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"

 

1 answer

0 votes
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2019

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.

David Gard
Contributor
April 16, 2019

Hello @Tom Bradshaw

For some reason my question is on here twice, and I've already answered the other one.

https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/Pipeline-azure-functions-deploy-failing-because-it-can-t-find/qaq-p/1056786

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events