从Azure功能中访问Devops Azure管道工件

发布于 2025-02-09 20:10:27 字数 1233 浏览 2 评论 0 原文

我正在使用ARM模板为我的Azure资源创建CI/CD管道。 在我的手臂模板中,我使用 zipdeploy 来部署Azure功能的代码。

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

基本上,我需要指定软件包,需要通过Internet访问它。

在我的Azure管道中,我正在创建我的功能的邮政编码,并使用 dotnet Publish 发布到Azure Pipeline伪像 然后我得到的URL: https://dev.azure.com/ifolor/_apis/resources/containers/containers/qur-(build.containerid)/drop?itempath=drop/myfunction.zip

任务

此URL是私有的,Azure函数无法访问此工件,

是否可以从Azure Portal中给我的Azure函数访问权限以从Azure Pipeline访问管道工件?

管道工件:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゃ懵逼小萝莉 2025-02-16 20:10:27

是否可以从Azure Portal给我的Azure函数访问权限以从Azure Pipeline访问管道伪像?

?如文档

IE

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

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'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文