Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/azd/pkg/project/service_target_containerapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ func (at *containerAppTarget) Deploy(
moduleName = serviceConfig.Name
}

modulePath := filepath.Join(serviceConfig.Project.Infra.Path, moduleName)
infraRoot := serviceConfig.Project.Infra.Path
if !filepath.IsAbs(infraRoot) {
infraRoot = filepath.Join(serviceConfig.Project.Path, infraRoot)
}
modulePath := filepath.Join(infraRoot, moduleName)
bicepPath := modulePath + ".bicep"
bicepParametersPath := modulePath + ".parameters.json"
bicepParamPath := modulePath + ".bicepparam"
Expand Down
8 changes: 7 additions & 1 deletion cli/azd/test/functional/publish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path/filepath"
"testing"

"github.com/azure/azure-dev/cli/azd/pkg/environment"
"github.com/azure/azure-dev/cli/azd/pkg/environment/azdcontext"
"github.com/azure/azure-dev/cli/azd/pkg/osutil"
"github.com/azure/azure-dev/cli/azd/test/azdcli"
Expand All @@ -17,7 +18,6 @@ import (
)

func Test_CLI_Publish_ContainerApp_RemoteBuild(t *testing.T) {
t.Skip("taking 53 minutes. Needs to be re-designed - https://github.com/Azure/azure-dev/issues/6059")
t.Parallel()

tests := []struct {
Expand All @@ -42,6 +42,8 @@ func Test_CLI_Publish_ContainerApp_RemoteBuild(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

ctx, cancel := newTestContext(t)
defer cancel()

Expand Down Expand Up @@ -94,6 +96,10 @@ func Test_CLI_Publish_ContainerApp_RemoteBuild(t *testing.T) {

_, err = cli.RunCommand(ctx, "down", "--force", "--purge")
require.NoError(t, err)

if session != nil {
session.Variables[recording.SubscriptionIdKey] = env[environment.SubscriptionIdEnvVarName]
}
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9405,3 +9405,4 @@ interactions:
---
env_name: azdtest-l2781fd
time: "1758301127"
subscription_id: 4d042dc6-fe17-4698-a23f-ec6a8d1e98f4
Original file line number Diff line number Diff line change
Expand Up @@ -9044,3 +9044,4 @@ interactions:
---
env_name: azdtest-l5e39d5
time: "1758299513"
subscription_id: 4d042dc6-fe17-4698-a23f-ec6a8d1e98f4

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "1.0"
tool: dotnet
interactions:
- id: 0
args:
- publish
- /private/var/folders/h2/5h0c91tn2v1cr579ktgk37kc0000gn/T/Test_CLI_Up_Down_ContainerApp1618671145/001/src/dotnet
- -r
- linux-x64
- -c
- Release
- /t:PublishContainer
- -p:ContainerRepository=containerapp/web-azdtest-d8f2553
- -p:ContainerImageTag=azd-deploy-1762387040
- -p:ContainerRegistry=crjkkakyyqrocso.azurecr.io
- --getProperty:GeneratedContainerConfiguration
exitCode: 0
stdout: |
{"config":{"ExposedPorts":{"8080/tcp":{}},"Labels":{"org.opencontainers.image.created":"2025-11-05T23:59:31.3804070Z","org.opencontainers.artifact.created":"2025-11-05T23:59:31.3804070Z","org.opencontainers.image.authors":"webapp","org.opencontainers.image.version":"1.0.0","org.opencontainers.image.base.name":"mcr.microsoft.com/dotnet/aspnet:8.0","net.dot.runtime.majorminor":"8.0","net.dot.sdk.version":"9.0.305","org.opencontainers.image.base.digest":"sha256:b4df5aee4f401621fc616334309cfb914624e8ed8f3607f2c6714a038111baa7"},"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","APP_UID=1654","ASPNETCORE_HTTP_PORTS=8080","DOTNET_RUNNING_IN_CONTAINER=true","DOTNET_VERSION=8.0.21","ASPNET_VERSION=8.0.21"],"WorkingDir":"/app/","Entrypoint":["dotnet","/app/webapp.dll"],"User":"1654"},"created":"2025-11-05T23:59:32.8674380Z","rootfs":{"type":"layers","diff_ids":["sha256:b512279032aa717092385dda875fffdcd96e4a4ad384225152522ac7bd5340a8","sha256:137be0c3f2904e7c42930108bf386895f45c0523524c510e40ab6b9c8b727778","sha256:1c42cec6593c327f0e98554927f55246abe682846da908c147117b11d156fee1","sha256:3793cc3e5af20fe55f3d3eee1f380ef982acb8c4e45fcbd58c88be150a74e3fb","sha256:6dad882e06f553c2cad7a1fa587b7bc328283a3e47a30dae2443e72df16ee7a8","sha256:34512dbb3622e41f2cbc4d2d44b0c6229ddc4f60ea4dc2b4a4b94f52db26c0b0","sha256:d0819a30927d4e2e9689c1f2ddd7c2ffa2e5bf47dd22833b20b071ffe5434560"]},"architecture":"amd64","os":"linux","history":[{"comment":"debuerreotype 0.16","created":"2025-11-03T20:44:10.0000000Z","created_by":"# debian.sh --arch \u0027amd64\u0027 out/ \u0027bookworm\u0027 \u0027@1762202650\u0027"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:09.6196518Z","created_by":"ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:09.6196518Z","created_by":"RUN /bin/sh -c apt-get update \u0026\u0026 apt-get install -y --no-install-recommends ca-certificates libc6 libgcc-s1 libicu72 libssl3 libstdc\u002B\u002B6 tzdata zlib1g \u0026\u0026 rm -rf /var/lib/apt/lists/* # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:11.4179398Z","created_by":"RUN /bin/sh -c groupadd --gid=$APP_UID app \u0026\u0026 useradd --no-log-init --uid=$APP_UID --gid=$APP_UID --create-home app # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:19.2821482Z","created_by":"ENV DOTNET_VERSION=8.0.21","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:19.2821482Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:20.5077889Z","created_by":"RUN /bin/sh -c ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:26.9742322Z","created_by":"ENV ASPNET_VERSION=8.0.21","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:26.9742322Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"author":".NET SDK","created":"2025-11-05T23:59:32.8674310Z","created_by":".NET SDK Container Tooling, version 9.0.305-servicing.25421.12\u002B3fc74f35299b08613acefa6fa7d70ccd72ff6139"}]}
stderr: ""

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ interactions:
- id: 0
args:
- publish
- /private/var/folders/6n/sxbj12js5ksg6ztn0kslqp400000gn/T/Test_CLI_Up_Down_ContainerAppDotNetPublish3940537069/001/src/dotnet
- /private/var/folders/h2/5h0c91tn2v1cr579ktgk37kc0000gn/T/Test_CLI_Up_Down_ContainerAppDotNetPublish696448/001/src/dotnet
- -r
- linux-x64
- -c
- Release
- /t:PublishContainer
- -p:ContainerRepository=containerapp/web-azdtest-de207ca
- -p:ContainerImageTag=azd-deploy-1732146560
- -p:ContainerRegistry=crtf5bjllihraai.azurecr.io
- -p:ContainerRepository=containerapp/web-azdtest-d2b15a5
- -p:ContainerImageTag=azd-deploy-1762387040
- -p:ContainerRegistry=crzfg4bopzbew7y.azurecr.io
- --getProperty:GeneratedContainerConfiguration
exitCode: 0
stdout: |
{"config":{"ExposedPorts":{"8080/tcp":{}},"Labels":{"org.opencontainers.image.created":"2024-11-20T23:52:02.8460760Z","org.opencontainers.artifact.created":"2024-11-20T23:52:02.8460760Z","org.opencontainers.image.authors":"webapp","org.opencontainers.image.version":"1.0.0","org.opencontainers.image.base.name":"mcr.microsoft.com/dotnet/aspnet:8.0","net.dot.runtime.majorminor":"8.0","net.dot.sdk.version":"9.0.100-rc.2.24474.11","org.opencontainers.image.base.digest":"sha256:3e2d76f7d3310b31e6400154e8f718600138db5d5ec9c37748bbda6922182ead"},"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","APP_UID=1654","ASPNETCORE_HTTP_PORTS=8080","DOTNET_RUNNING_IN_CONTAINER=true","DOTNET_VERSION=8.0.11","ASPNET_VERSION=8.0.11"],"WorkingDir":"/app/","Entrypoint":["dotnet","/app/webapp.dll"],"User":"1654"},"created":"2024-11-20T23:52:04.0532130Z","rootfs":{"type":"layers","diff_ids":["sha256:c3548211b8264f8bfa47a6727043a64f1791b82ac965a284a7ea187e971a95e2","sha256:24716a9c28f5c0fcc7713347708e93e9531a58629fc22b47bd45f19b591c7453","sha256:2ffebcb9c50a8e37858d22d39df5e8a8004b2e12923ee60c6344162427424960","sha256:dec72eb2a8b47bbe9e0ffc56fb9c1a9e577e1b9febb385e836ee0977254b7c0d","sha256:20c9409270c12ce0c1bb3271d534508956fdc68f489365ffbb40a14532f86e88","sha256:9e43e3f4b30f02815d600b02af454c449b59d5c4dd5f3afa4e49c3ffd6ecd025","sha256:1f45fbd6c62e42e4da992eaf73808abd3b9fbf40cd08e7cebf3a33cf3eee0c10"]},"architecture":"amd64","os":"linux","history":[{"comment":"buildkit.dockerfile.v0","created":"2024-11-11T00:00:00.0000000Z","created_by":"ADD rootfs.tar.xz / # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-11-11T00:00:00.0000000Z","created_by":"CMD [\u0022bash\u0022]","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:09.3239341Z","created_by":"ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:09.3239341Z","created_by":"RUN /bin/sh -c apt-get update \u0026\u0026 apt-get install -y --no-install-recommends ca-certificates libc6 libgcc-s1 libicu72 libssl3 libstdc\u002B\u002B6 tzdata zlib1g \u0026\u0026 rm -rf /var/lib/apt/lists/* # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:10.7740643Z","created_by":"RUN /bin/sh -c groupadd --gid=$APP_UID app \u0026\u0026 useradd -l --uid=$APP_UID --gid=$APP_UID --create-home app # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:16.8668835Z","created_by":"ENV DOTNET_VERSION=8.0.11","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:16.8668835Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:17.7626695Z","created_by":"RUN /bin/sh -c ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:23.2518218Z","created_by":"ENV ASPNET_VERSION=8.0.11","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-11-12T18:41:23.2518218Z","created_by":"COPY /shared/Microsoft.AspNetCore.App /usr/share/dotnet/shared/Microsoft.AspNetCore.App # buildkit"},{"author":".NET SDK","created":"2024-11-20T23:52:04.0531950Z","created_by":".NET SDK Container Tooling, version 9.0.100-rc.2.24474.11\u002B315e1305dbe1a5ef5870faab5dc12d3a375f61eb"}]}
{"config":{"ExposedPorts":{"8080/tcp":{}},"Labels":{"org.opencontainers.image.created":"2025-11-05T23:59:31.3727130Z","org.opencontainers.artifact.created":"2025-11-05T23:59:31.3727130Z","org.opencontainers.image.authors":"webapp","org.opencontainers.image.version":"1.0.0","org.opencontainers.image.base.name":"mcr.microsoft.com/dotnet/aspnet:8.0","net.dot.runtime.majorminor":"8.0","net.dot.sdk.version":"9.0.305","org.opencontainers.image.base.digest":"sha256:b4df5aee4f401621fc616334309cfb914624e8ed8f3607f2c6714a038111baa7"},"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","APP_UID=1654","ASPNETCORE_HTTP_PORTS=8080","DOTNET_RUNNING_IN_CONTAINER=true","DOTNET_VERSION=8.0.21","ASPNET_VERSION=8.0.21"],"WorkingDir":"/app/","Entrypoint":["dotnet","/app/webapp.dll"],"User":"1654"},"created":"2025-11-05T23:59:32.8674660Z","rootfs":{"type":"layers","diff_ids":["sha256:b512279032aa717092385dda875fffdcd96e4a4ad384225152522ac7bd5340a8","sha256:137be0c3f2904e7c42930108bf386895f45c0523524c510e40ab6b9c8b727778","sha256:1c42cec6593c327f0e98554927f55246abe682846da908c147117b11d156fee1","sha256:3793cc3e5af20fe55f3d3eee1f380ef982acb8c4e45fcbd58c88be150a74e3fb","sha256:6dad882e06f553c2cad7a1fa587b7bc328283a3e47a30dae2443e72df16ee7a8","sha256:34512dbb3622e41f2cbc4d2d44b0c6229ddc4f60ea4dc2b4a4b94f52db26c0b0","sha256:e0686941750751ae4b06edb007140aa6ebdc48253bc4527e8216f2b9028210a0"]},"architecture":"amd64","os":"linux","history":[{"comment":"debuerreotype 0.16","created":"2025-11-03T20:44:10.0000000Z","created_by":"# debian.sh --arch \u0027amd64\u0027 out/ \u0027bookworm\u0027 \u0027@1762202650\u0027"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:09.6196518Z","created_by":"ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:09.6196518Z","created_by":"RUN /bin/sh -c apt-get update \u0026\u0026 apt-get install -y --no-install-recommends ca-certificates libc6 libgcc-s1 libicu72 libssl3 libstdc\u002B\u002B6 tzdata zlib1g \u0026\u0026 rm -rf /var/lib/apt/lists/* # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:11.4179398Z","created_by":"RUN /bin/sh -c groupadd --gid=$APP_UID app \u0026\u0026 useradd --no-log-init --uid=$APP_UID --gid=$APP_UID --create-home app # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:19.2821482Z","created_by":"ENV DOTNET_VERSION=8.0.21","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:19.2821482Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:20.5077889Z","created_by":"RUN /bin/sh -c ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:26.9742322Z","created_by":"ENV ASPNET_VERSION=8.0.21","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2025-11-04T04:39:26.9742322Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"author":".NET SDK","created":"2025-11-05T23:59:32.8674600Z","created_by":".NET SDK Container Tooling, version 9.0.305-servicing.25421.12\u002B3fc74f35299b08613acefa6fa7d70ccd72ff6139"}]}
stderr: ""

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ module web 'br/public:avm/res/app/container-app:0.8.0' = {
tags: { 'azd-env-name': environmentName, 'azd-service-name': 'web' }
}
}

output WEBSITE_URL string = 'https://${web.outputs.fqdn}'
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@ param location string = resourceGroup().location
var tags = { 'azd-env-name': environmentName }
var resourceToken = toLower(uniqueString(subscription().id, environmentName, location))

resource functions 'Microsoft.Web/sites@2022-03-01' = {
resource functions 'Microsoft.Web/sites@2023-12-01' = {
name: 'func-${resourceToken}'
location: location
kind: 'functionapp,linux'
tags: union(tags, { 'azd-service-name': 'func' })
properties: {
enabled: true
serverFarmId: appServicePlan.id
serverFarmId: flexFunctionPlan.id
httpsOnly: false
reserved: true

siteConfig: {
functionAppScaleLimit: 200
use32BitWorkerProcess: false
ftpsState: 'FtpsOnly'
cors: {
allowedOrigins: [
// allow testing through the Azure portal
'https://ms.portal.azure.com'
]
supportCredentials: false
functionAppConfig: {
deployment: {
storage: {
type: 'blobContainer'
value: '${storage.properties.primaryEndpoints.blob}${blobContainer.name}'
authentication: {
type: 'SystemAssignedIdentity'
}
}
}
scaleAndConcurrency: {
maximumInstanceCount: 100
instanceMemoryMB: 2048
}
runtime: {
name: 'python'
version: '3.11'
}
}
}
Expand All @@ -36,10 +40,7 @@ resource functions 'Microsoft.Web/sites@2022-03-01' = {
name: 'appsettings'
// https://docs.microsoft.com/azure/azure-functions/functions-app-settings
properties: {
FUNCTIONS_EXTENSION_VERSION: '~4'
FUNCTIONS_WORKER_RUNTIME: 'python'
AzureWebJobsStorage__accountName: storage.name
SCM_DO_BUILD_DURING_DEPLOYMENT: 'true'
}
}
}
Expand All @@ -57,6 +58,19 @@ resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
}
}

resource blobServices 'Microsoft.Storage/storageAccounts/blobServices@2025-01-01' = {
name: 'default'
parent: storage
}

resource blobContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2025-01-01' = {
name: 'func-deploy'
parent: blobServices
properties: {
publicAccess: 'None'
}
}

resource storage_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(storage.id, functions.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b'))
properties: {
Expand All @@ -67,17 +81,14 @@ resource storage_StorageBlobDataContributor 'Microsoft.Authorization/roleAssignm
scope: storage
}

resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
resource flexFunctionPlan 'Microsoft.Web/serverfarms@2023-12-01' = {
name: 'plan-${resourceToken}'
location: location
tags: tags
kind: 'functionapp'
sku: {
name: 'Y1'
tier: 'Dynamic'
size: 'Y1'
family: 'Y'
capacity: 0
tier: 'FlexConsumption'
name: 'FC1'
}
properties: {
reserved: true
Expand Down
Loading
Loading