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

az functionapp create --environment only works for containerapp environment in the same resource group #30795

Open
sausagedogcoffee opened this issue Feb 10, 2025 · 6 comments
Assignees
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@sausagedogcoffee
Copy link

Describe the bug

When using " az functionapp create" for deploying a function to a containerapp environment, the "--environment" must be in the same resource group as "--resource-group".

--storage-account also used to have this issue but you can reference the full ID to fix it.

Related command

az functionapp create --name functionapp1 --resource-group rg-apps --environment "cae-apps"

Errors

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 430, in get_managed_environment
azure.cli.core.azclierror.ResourceNotFoundError: Retrieving managed environment failed with an exception:
(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/x' under resource group 'rg-x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.App/managedEnvironments/x' under resource group 'rg-x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
The environment does not exist

cli.azure.cli.core.azclierror: Retrieving managed environment failed with an exception:
(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/cae-digital-dev-ae-backend' under resource group 'x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound

Issue script & Debug output

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 430, in get_managed_environment
azure.cli.core.azclierror.ResourceNotFoundError: Retrieving managed environment failed with an exception:
(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/x' under resource group 'rg-x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.App/managedEnvironments/x' under resource group 'rg-x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
The environment does not exist

cli.azure.cli.core.azclierror: Retrieving managed environment failed with an exception:
(ResourceNotFound) The Resource 'Microsoft.App/managedEnvironments/cae-digital-dev-ae-backend' under resource group 'x' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound

Expected behavior

The function app is deployed to the container app in another resource group, this is what happens when deploying using the portal

Environment Summary

azure-cli 2.67.0 *

core 2.67.0 *
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'

Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Additional context

No response

@sausagedogcoffee sausagedogcoffee added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 10, 2025
Copy link

Hi @sausagedogcoffee,

2.67.0 is not the latest Azure CLI(2.68.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Feb 10, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 10, 2025

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot labels Feb 10, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels Feb 10, 2025
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

Cross resource group storage account id is supported, but there is a code bug that prevents it from working right.

Reference:

Solution 2:

Fixed, thanks @theMichaelB

Reference:

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

@sausagedogcoffee
Copy link
Author

The similar issues suggested suffered from the same issue but were resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

6 participants