Search in sources :

Example 1 with WebAppBasePropertyViewPresenter

use of com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter in project azure-tools-for-java by Microsoft.

the class FunctionAppPropertyView method createPresenter.

@Override
protected WebAppBasePropertyViewPresenter createPresenter() {
    return new WebAppBasePropertyViewPresenter() {

        @Override
        protected IFunctionApp getWebAppBase(String subscriptionId, String functionAppId, String name) {
            return Azure.az(AzureAppService.class).subscription(subscriptionId).functionApp(functionAppId);
        }

        @Override
        protected void updateAppSettings(String subscriptionId, String functionAppId, String name, Map toUpdate, Set toRemove) {
            final IFunctionApp functionApp = getWebAppBase(subscriptionId, functionAppId, name);
            final IAppServiceUpdater appServiceUpdater = functionApp.update();
            appServiceUpdater.withAppSettings(toUpdate);
            toRemove.forEach(key -> appServiceUpdater.withoutAppSettings((String) key));
            appServiceUpdater.commit();
        }
    };
}
Also used : Set(java.util.Set) IAppServiceUpdater(com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater) IFunctionApp(com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp) Map(java.util.Map) WebAppBasePropertyViewPresenter(com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter)

Aggregations

IAppServiceUpdater (com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater)1 IFunctionApp (com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp)1 WebAppBasePropertyViewPresenter (com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter)1 Map (java.util.Map)1 Set (java.util.Set)1