diff --git a/.github/workflows/azure-messaging-function.yml b/.github/workflows/azure-messaging-function.yml index 33ec4088..c9c4c598 100644 --- a/.github/workflows/azure-messaging-function.yml +++ b/.github/workflows/azure-messaging-function.yml @@ -28,10 +28,17 @@ jobs: pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' dotnet build --configuration Release --output ./output popd + + - name: Get Pubilsh Profile + id: getPublishProfile + run: | + echo "::set-output name=PUBLISH_PROFILE::$(az webapp deployment list-publishing-profiles -g '${{ needs.terraform.outputs.rgName }}' -n 'app-service-name' --xml)" + + - name: 'Run Azure Functions Action' uses: Azure/functions-action@v1 id: fa with: app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output' - publish-profile: ${{ secrets.AZURE_MESSAGING_FUNCTIONAPP_PUBLISH_PROFILE }} + publish-profile: ${{ steps.getPublishProfile.outputs.PUBLISH_PROFILE }} diff --git a/.github/workflows/terraform-create-resource.yml b/.github/workflows/terraform-create-resource.yml index ced04bbb..c40e7f6b 100644 --- a/.github/workflows/terraform-create-resource.yml +++ b/.github/workflows/terraform-create-resource.yml @@ -17,6 +17,9 @@ jobs: ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} + + outputs: + rgName: ${{ steps.getResourceGroupName.outputs.rgName }} steps: - name: Checkout @@ -37,3 +40,9 @@ jobs: - name: Terraform Apply run: terraform apply -auto-approve working-directory: ./terraform/terraform-create-resource + + - name: Get Resource Group name + id: getResourceGroupName + run: | + echo "::set-output name=rgName::$(terraform output -raw rgName)" + diff --git a/terraform/terraform-create-resource/main.tf b/terraform/terraform-create-resource/main.tf index dc76eaa0..66a8c19c 100644 --- a/terraform/terraform-create-resource/main.tf +++ b/terraform/terraform-create-resource/main.tf @@ -27,3 +27,7 @@ provider "azurerm" { features {} } +output "rgName" { + value = azurerm_resource_group.rg.name +} +