Azure / functions-action

Enable GitHub developers to deploy to Azure Function Apps using GitHub Actions
MIT License
152 stars 75 forks source link

I'm getting an error: SCM credential does not match slot-name staging) when i try to deploy to "staging" deployment slot #200

Closed adiaz-v closed 10 months ago

adiaz-v commented 1 year ago

So in a previous step i create staging slot if it doesn't exists:

az functionapp deployment slot create --name <function_app_name> --resource-group <function_app_rg> --configuration-source <function_app_name> --slot staging

Then i get the publish profile from that recently created deployment slot and store it as env variable:

slot_publish_profile=$(az functionapp deployment list-publishing-profiles --name <function_app_name> --resource-group <function_app_rg> --slot staging --xml)
slot_name="staging"
echo "PUBLISH_PROFILE=$slot_publish_profile" >> $GITHUB_ENV 
echo "SLOT_NAME=$slot_name" >> $GITHUB_ENV

And call the Azure/functions-action as folllows:

- name: 'Deploy Azure Functions to Staging'
        uses: Azure/functions-action@v1.5.1
        with:
          app-name: <function_app_name>
          slot-name: ${{ env.SLOT_NAME }}
          package: <function_name>.zip
          publish-profile: ${{ env.PUBLISH_PROFILE }}

Then I'm getting this error which is not expected since I'm creating the "staging" slot and getting the publish profile for that same slot dynamically.

Successfully parsed SCM credential from publish-profile format.
Error: Execution Exception (state: ValidateParameter) (step: Invocation)
Error:   At ValidateParameter, slot-name : SCM credential does not match slot-name staging. Please ensure the slot-name parameter has correct casing and the publish-profile is acquired from your function app's slot rather than your main production site..
Error: Deployment Failed!
github-actions[bot] commented 12 months ago

This issue is idle because it has been open for 14 days with no activity.

patelchandni commented 10 months ago

@adiaz-v we will need app details and logs to further investigate this type of issues. So, please open a support ticket from azure portal if this issue still persists.