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

Explicit option to block automatic resource/plan/app creation #1651

Closed
sgalles opened this issue Jul 19, 2021 · 6 comments
Closed

Explicit option to block automatic resource/plan/app creation #1651

sgalles opened this issue Jul 19, 2021 · 6 comments
Assignees

Comments

@sgalles
Copy link

sgalles commented Jul 19, 2021

When the plugin is used to deploy on a resource/plan/app that was already manually created, it would be nice to have an option that explicitly disables the accidental automatic creation of any Azure resource/plan/app in the Subscription.
Because when there's a misconfiguration/typo in my pom.xml, or if I'm on the wrong Subscription, I'd like an explicit error (resource not found...) not the creation of the wrong resource/plan/app at the wrong place

Thanks

@andxu
Copy link
Contributor

andxu commented Aug 9, 2021

Would you like a confirm parameter in deploy, which actually lists all the operations/changes(only do read operation on your subscription) and when you press 'Y', it will continue to deploy (very similar to the terraform plan command: https://www.terraform.io/docs/cli/commands/plan.html)

mvn azure-webapp:deploy --confirm

@yucwan
Copy link
Contributor

yucwan commented Aug 9, 2021

What if we add a new parameter like:
mvn azure-webapp:deploy --prevent-creation
which will always try to update existing Azure resources and prevent creating any resource group/app service plan/app service.

@andxu
Copy link
Contributor

andxu commented Aug 26, 2021

Will add a flag in Sep for preventing any kind of resource creation.

@andxu andxu pinned this issue Aug 26, 2021
@sgalles
Copy link
Author

sgalles commented Sep 2, 2021

Hi, thanks for your answers, and sorry for the delayed response.
A flag on the CLI could be useful for certain use cases, but ideally I was rather looking for something that doesn't depend on the user doing the right thing with the CLI command.
To put it differently I was looking for a flag directly in the configuration of the plugin in the XML file that would prevent all users from creating new resources by default. Because in my case, for instance, a user connected on the wrong subscription wouldn't even know that he is going to create new resources, and wouldn't even think about adding the new --prevent-creation option.

@andxu
Copy link
Contributor

andxu commented Sep 22, 2021

#1762, use -Dazure.resource.create.skip=true or -DskipCreateAzureResource.

@andxu
Copy link
Contributor

andxu commented Sep 22, 2021

or use pom configuration:

   <plugin>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-webapp-maven-plugin</artifactId>
        <version>2.2.0</version>
        <configuration>
           <resourceGroup>andxu-test-rg</resourceGroup>
          <appName>andxu-test-app</appName>
          <region>westus</region>
          <skipCreateAzureResource>true</skipCreateAzureResource>
        </configuration>
      </plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants