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

Is there any option to generate storage accounts in the given resource group? #13

Closed
xlight05 opened this issue Jun 23, 2021 · 3 comments
Assignees
Labels
question Further information is requested waiting-for-customer Waiting for inputs from customer

Comments

@xlight05
Copy link

Hi,
I've generated sp by specifying the resource group.
Ex - az ad sp create-for-rbac --name "myApp" --role contributor \ --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \ --sdk-auth
Even though I mention resource-group-name in the azure/build-vm-image@v0 i noticed it automatically creates a separate resource group for build artifacts called IT_{group}_imagebuilderTempla_{id}. This becomes a slight issue when deleting the resources that are created by this workflow.
I've wrote this CLI command for cleaning these resources.
az group delete --name $(az group list --tag imageTemplateName=imagebuilderTemplate_${{ steps.write.outputs.old-image-id }} -otable --query "[].name" -otsv) -y

However I noticed az group list doesn't show anything other than the resource group I gave permission when creating the sp. I could solve this problem by not restricting the sp to the resoruce group but is this would be solved if we didn't create a new resource group and instead create all resources under the resource group we given. wdyt?

@github-actions
Copy link

github-actions bot commented Jul 7, 2021

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Jul 7, 2021
@kanika1894 kanika1894 added the question Further information is requested label Jul 19, 2021
@BALAGA-GAYATRI
Copy link
Contributor

Hey @xlight05 As per Azure image builder design -

When the Image Template Resource is created you will see a staging resource group created in your subscription, in the format: IT_(GUID). The staging resource group contains files and scripts referenced in the File, Shell, PowerShell customization in the ScriptURI property.
When the build finishes all resources will be deleted, except for the staging resource group and the storage account, to remove these you will delete the Image Template resource, or you can leave them there to run the build again.

So direct deletion of image template resource which was created in your resource group will directly delete the staging Resource Group and storage account. Current SPN should suffice in this case. Visit this doc for reference.

@github-actions github-actions bot removed the idle Inactive for 14 days label Sep 28, 2021
@kanika1894 kanika1894 added the waiting-for-customer Waiting for inputs from customer label Sep 29, 2021
@kanika1894
Copy link
Contributor

Closing due to inactivity. Please feel to reopen in case of any queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested waiting-for-customer Waiting for inputs from customer
Projects
None yet
Development

No branches or pull requests

4 participants