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

[ISSUE]- Resource Group not found when trying to deploy subscription scoped deployment via GitHub Actions.

Open AaronSaikovski opened this issue 1 year ago • 4 comments

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

azure-dev.txt

AaronSaikovski avatar Oct 23 '24 06:10 AaronSaikovski

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.

vhvb1989 avatar Oct 25 '24 05:10 vhvb1989

can you share with you directly if possible?

AaronSaikovski avatar Oct 25 '24 05:10 AaronSaikovski

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

vhvb1989 avatar Oct 25 '24 06:10 vhvb1989

files.zip sure see attached here

AaronSaikovski avatar Oct 25 '24 20:10 AaronSaikovski

please see atttached files in thread

AaronSaikovski avatar Nov 03 '24 22:11 AaronSaikovski

@v-xuto can you triage the repro above and update findings? cc @vhvb1989

rajeshkamal5050 avatar Nov 04 '24 17:11 rajeshkamal5050

@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 rsg to resource rsg, and then change the scope value of each other module to rsg, as shown below: Image

Menghua1 avatar Nov 05 '24 07:11 Menghua1

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:

— 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 avatar Nov 05 '24 23:11 AaronSaikovski

@AaronSaikovski If you are sure that this issue has been resolved, I will close it.

Menghua1 avatar Nov 06 '24 02:11 Menghua1

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: @.***>

AaronSaikovski avatar Nov 06 '24 02:11 AaronSaikovski