[ISSUE]- Resource Group not found when trying to deploy subscription scoped deployment via GitHub Actions.
Output from azd version
azd version 1.10.3 (commit 0595f33fe948ee6df3da492567e3e7943cb9a733)
Describe the bug When trying to deploy Azure infrastructure using 'subscription scoped' bicep code, it is reporting it cannot find the resource group on the first run. The first pipeline runs then fails then the resource group is created sometime later. Then we can rerun the pipeline and it finds the resource group on the second run and then deploys the resources properly. The Bicep code is subscription scoped and does create the resource group when running azd up locally.
the pipeline code is attached
Can you share the bicep you are using to reproduce? If you can, please share the bicep files and any parameters you are using for the bicep.
can you share with you directly if possible?
can you share with you directly if possible?
Sure, feel free to add me to a private repo, if you want. I can take a look. Or, if you can create simple public repo where you can reproduce the issue (removing any confidential staff), that would be ideal
files.zip sure see attached here
please see atttached files in thread
@v-xuto can you triage the repro above and update findings? cc @vhvb1989
@AaronSaikovski This problem occurs because there is no dependency defined between the rsg module and other modules in the main.bicep file. Therefore, the Resource Group and other resources (such as App Service Plan) are created at the same time. When the App Service Plan is being created, the resource group has not yet been created. At this time, the Resource group could not be found message is reported. The suggestions are as follows:
- Refer to todo-csharp-sql, change the
module rsgtoresource rsg, and then change thescopevalue of each other module torsg, as shown below:
Thanks thats a weird issue but it seems to have been fixed. thanks
Regards, Aaron Saikovski
Mob: +61 410 480 971 Email: @.*** Skype: aaron.saikovski LinkedIn: http://www.linkedin.com/pub/aaron-saikovski/3b/b9/159
From: Menghua Chen (MSFT) @.> Sent: Tuesday, 5 November 2024 6:52 PM To: Azure/azure-dev @.> Cc: Aaron Saikovski @.>; Mention @.> Subject: Re: [Azure/azure-dev] [ISSUE]- Resource Group not found when trying to deploy subscription scoped deployment via GitHub Actions. (Issue #4478)
@AaronSaikovskihttps://github.com/AaronSaikovski This problem occurs because there is no dependency defined between the rsg module and other modules in the main.bicep file. Therefore, the Resource Group and other resources (such as key vault) are created at the same time. When the key vault is being created, the resource group has not yet been created. At this time, the Resource group could not be found message is reported. The suggestions are as follows:
- Refer to todo-csharp-sqlhttps://github.com/Azure-Samples/todo-csharp-sql/blob/main/infra/main.bicep#L50-L67, change the module rsg to resource rsg, and then change the scope value of each other module to rsg, as shown below: image.png (view on web)https://github.com/user-attachments/assets/2283aeec-b900-4aa3-820d-d915bfab4b34
— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-dev/issues/4478#issuecomment-2456464341, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNLMEGVYFMAFC4WHIKDLJ3Z7B2L3AVCNFSM6AAAAABQOAFL4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJWGQ3DIMZUGE. You are receiving this because you were mentioned.Message ID: @.***>
@AaronSaikovski If you are sure that this issue has been resolved, I will close it.
yes please
Regards, Aaron Saikovski
Mob: +61 410 480 971 Email: @.*** Skype: aaron.saikovski LinkedIn: http://www.linkedin.com/pub/aaron-saikovski/3b/b9/159
From: Menghua Chen (MSFT) @.> Sent: Wednesday, 6 November 2024 1:56 PM To: Azure/azure-dev @.> Cc: Aaron Saikovski @.>; Mention @.> Subject: Re: [Azure/azure-dev] [ISSUE]- Resource Group not found when trying to deploy subscription scoped deployment via GitHub Actions. (Issue #4478)
@AaronSaikovskihttps://github.com/AaronSaikovski If you are sure that this issue has been resolved, I will close it.
— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-dev/issues/4478#issuecomment-2458628601, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNLMEAYM5R4U76B2RATB43Z7GAORAVCNFSM6AAAAABQOAFL4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJYGYZDQNRQGE. You are receiving this because you were mentioned.Message ID: @.***>