azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

Extend Resource Type Validation to Include Container App Jobs

Open ianphil opened this issue 1 year ago • 1 comments

Overview

This pull request enhances the validation logic within the validateTargetResource function of the container app deployment process. Previously, our validation was limited to AzureResourceTypeContainerApp resource types. We've now expanded this to also include AzureResourceTypeContainerAppJob, catering to scenarios involving both container apps and container app jobs within Azure.

re: #2743

Changes

  • Modified the validateTargetResource function to check for AzureResourceTypeContainerAppJob in addition to the existing AzureResourceTypeContainerApp.
  • Implemented a nested conditional check within the resource type validation to ensure either of the resource types is correctly identified and validated without changing the function signature of checkResourceType.

Impact

This update ensures our deployment tooling can accurately validate target resources for both container apps and container app jobs, enhancing its flexibility and coverage. It's a crucial step towards supporting a wider array of Azure resources, thereby improving our automation capabilities in cloud environments.

Testing

  • TODO: Updated unit tests to cover the new logic introduced for resource type validation.
  • TODO: Conducted integration testing with both resource types to ensure the validation behaves as expected without introducing regressions.

Please review the changes and provide your feedback.

ianphil avatar Apr 02 '24 14:04 ianphil

Questions:

  • Should AzureContainerAppJob be it's own top level "service target"? Or does this suffice as a mitigation to get folks working?
  • Will I need to create an azd template to complete this work?

I understand this doesn't account for the changes in deploy that need to occur. I'm wanting understand if this is the correct path before moving further.

ianphil avatar Apr 02 '24 15:04 ianphil