Jorge Freitas
Jorge Freitas

Reputation: 938

Accessing Devops Azure Pipeline Artifacts from from Azure Function

I am creating a CI/CD pipeline for my Azure Resources using ARM Template. In my Arm Template I am using zipdeploy to deploy the code of my azure function.

"resources": [
            {
              "apiVersion": "2021-02-01",
              "type": "extensions",
              "name": "zipdeploy",
              "dependsOn": [
                "[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
              ],
              "properties": {
                "packageUri": "[parameters('packageUri')]"
              }
            }
          ]

Basically, I need to specify the packageUri, it needs to be accessed over the internet.

In my Azure Pipeline I am creating a zip package of my function and publishing to Azure pipeline artifacts using dotnet publish and then I am getting the URL: https://dev.azure.com/ifolor/_apis/resources/Containers/$(Build.ContainerId)/drop?itemPath=drop/myfunction.zip

task: PublishBuildArtifacts@1

Problem:

This URL is private, the Azure function cannot access this artifact

Is it possible to give access permissions to my Azure function from Azure Portal to access the pipeline artifacts from Azure Pipeline?

Pipeline artifact: enter image description here

Upvotes: 0

Views: 689

Answers (1)

Daniel Mann
Daniel Mann

Reputation: 59045

Is it possible to give access permissions to my Azure function from Azure Portal to access the pipeline artifacts from Azure Pipeline?

No.

Typically, you don't use an ARM template to deploy your application, you use a continuous delivery pipeline that pushes the changes out to the site, as explained in the documentation.

i.e.

- task: AzureWebApp@1
  inputs:
    azureSubscription: '<Azure service connection>'
    appType: 'webAppLinux'
    appName: '<Name of web app>'
    package: '$(System.DefaultWorkingDirectory)/**/*.zip'

Upvotes: 0

Related Questions