Skip to content

Commit

Permalink
Rename authentication to auth in configuration with legacy setAuthent…
Browse files Browse the repository at this point in the history
…ication (#108)
  • Loading branch information
andxu committed Aug 24, 2021
1 parent de2204e commit d378352
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions azure-functions-gradle-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ All notable changes to the "Azure Function Plugin for Gradle" will be documented
- Support detach Application Insights from an existing function app

## 1.2.0
- Update depdendencies
- Update dependencies
- Fix issue [46](https://github.com/microsoft/azure-gradle-plugins/issues/46): java.io.IOException: Resource not found: /version.txt


## 1.1.0
- Update depdendencies
- Update dependencies
- Fix the plugin name in telemetry
- Fix bug: Cannot resolve func.exe when it is located at a folder with SPACE

Expand Down
2 changes: 1 addition & 1 deletion azure-functions-gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ azurefunctions {
<key> = <value>
}
authentication {
auth {
type = 'azure_cli'
}
// enable local debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AzureFunctionsExtension {
private String appServicePlanName;

@Nullable
private GradleAuthConfig authentication;
private GradleAuthConfig auth;

@Nullable
private Deployment deployment;
Expand Down Expand Up @@ -121,8 +121,8 @@ public String getAppServicePlanResourceGroup() {

@Input
@Optional
public GradleAuthConfig getAuthentication() {
return authentication;
public GradleAuthConfig getAuth() {
return auth;
}

@Input
Expand Down Expand Up @@ -191,9 +191,15 @@ public void setPricingTier(String pricingTier) {
this.pricingTier = pricingTier;
}

public void setAuth(Closure closure) {
this.auth = new GradleAuthConfig();
project.configure(auth, closure);
}

@Deprecated
public void setAuthentication(Closure closure) {
this.authentication = new GradleAuthConfig();
project.configure(authentication, closure);
this.auth = new GradleAuthConfig();
project.configure(auth, closure);
}

public void setDeployment(Closure closure) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public IProject getProject() {
public AzureAppService getOrCreateAzureAppServiceClient() {
if (appServiceClient == null) {
try {
GradleAuthHelper.login(functionsExtension.getAuthentication(), functionsExtension.getSubscription());
GradleAuthHelper.login(functionsExtension.getAuth(), functionsExtension.getSubscription());
appServiceClient = Azure.az(AzureAppService.class);
} catch (AzureToolkitRuntimeException e) {
throw new AzureToolkitRuntimeException(String.format("Cannot authenticate due to error %s", e.getMessage()), e);
Expand Down Expand Up @@ -135,7 +135,7 @@ public Map<String, String> getAppSettings() {

@Override
public GradleAuthConfig getAuth() {
return functionsExtension.getAuthentication();
return functionsExtension.getAuth();
}

@Override
Expand Down

0 comments on commit d378352

Please sign in to comment.