Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement]: Support Different Resource Groups for Container App and Environment in AzureContainerApps@1 #20594

Open
jsinghcode opened this issue Oct 25, 2024 · 0 comments

Comments

@jsinghcode
Copy link

Task name

AzureContainerApps@1

Describe your feature request here

Description

When deploying Container Apps in Azure, it is common for the Container Apps Environment and the Container App itself to reside in separate resource groups (e.g., the environment Dev-Environment in Resource Group A and the app MyContainerApp in Resource Group B). However, when using the AzureContainerApps@1 task in an Azure DevOps pipeline, specifying different resource groups for the environment and the app leads to an error, as the task expects both resources to be in the same group.

Steps to Reproduce

  1. Configure a pipeline with the AzureContainerApps@1 task:
    - stage: Deploy  
      jobs:
      - job:
        steps:
        - task: AzureContainerApps@1
          inputs:
            azureSubscription: 'MyAzureSubscription'
            acrName: 'myContainerRegistry'
            imageToDeploy: 'myContainerRegistry.azurecr.io/MyContainerApp:$(Build.BuildNumber)'
            containerAppName: 'MyContainerApp'
            resourceGroup: 'Resource Group B'
            containerAppEnvironment: 'Dev-Environment'
  2. Run the deployment.

Current Behavior
The deployment fails with the following error:

(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/Dev-Environment' under resource group 'Resource Group B' was not found.

Expected Behavior
It should be possible to specify a different resource group for the Container Apps Environment using a full resource ID path, allowing for more flexible resource configurations.

Proposed Solution
Enable support for specifying a full resource ID for the containerAppEnvironment input in the AzureContainerApps@1 task, like:

containerAppEnvironment: '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/Resource Group A/providers/Microsoft.App/managedEnvironments/Dev-Environment'

Full Example Task
Here is an example of the full task configuration with the proposed solution:

- stage: Deploy  
  jobs:
  - job:
    steps:
    - task: AzureContainerApps@1
      inputs:
        azureSubscription: 'MyAzureSubscription'
        acrName: 'myContainerRegistry'
        imageToDeploy: 'myContainerRegistry.azurecr.io/MyContainerApp:$(Build.BuildNumber)'
        containerAppName: 'MyContainerApp'
        resourceGroup: 'Resource Group B'
        containerAppEnvironment: '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/Resource Group A/providers/Microsoft.App/managedEnvironments/Dev-Environment'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants