Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.azure.core.management.AzureEnvironment;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.resourcemanager.AzureResourceManager;
import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties;
import com.azure.resourcemanager.appservice.models.FtpsState;
import com.azure.resourcemanager.appservice.models.FunctionApp;
import com.azure.resourcemanager.appservice.models.LogLevel;
import com.azure.core.management.Region;
Expand Down Expand Up @@ -61,11 +63,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) throw
.withLogLevel(LogLevel.VERBOSE)
.withApplicationLogsStoredOnFileSystem()
.attach()
.withFtpsState(FtpsState.ALL_ALLOWED)
.create();

System.out.println("Created function app " + app.name());
Utils.print(app);

app.manager().resourceManager().genericResources().define("ftp")
.withRegion(app.regionName())
.withExistingResourceGroup(app.resourceGroupName())
.withResourceType("basicPublishingCredentialsPolicies")
.withProviderNamespace("Microsoft.Web")
.withoutPlan()
.withParentResourcePath("sites/" + app.name())
.withApiVersion("2023-01-01")
.withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true))
.create();

//============================================================
// Deploy to app 1 through FTP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import com.azure.core.management.AzureEnvironment;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.resourcemanager.AzureResourceManager;
import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties;
import com.azure.resourcemanager.appservice.models.ConnectionStringType;
import com.azure.resourcemanager.appservice.models.FtpsState;
import com.azure.resourcemanager.appservice.models.PricingTier;
import com.azure.resourcemanager.appservice.models.RuntimeStack;
import com.azure.resourcemanager.appservice.models.WebApp;
Expand Down Expand Up @@ -101,11 +103,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) {
.withBuiltInImage(RuntimeStack.TOMCAT_8_5_JRE8)
.withConnectionString("storage.connectionString", connectionString, ConnectionStringType.CUSTOM)
.withAppSetting("storage.containerName", containerName)
.withFtpsState(FtpsState.ALL_ALLOWED)
.create();

System.out.println("Created web app " + app1.name());
Utils.print(app1);

app1.manager().resourceManager().genericResources().define("ftp")
.withRegion(app1.regionName())
.withExistingResourceGroup(app1.resourceGroupName())
.withResourceType("basicPublishingCredentialsPolicies")
.withProviderNamespace("Microsoft.Web")
.withoutPlan()
.withParentResourcePath("sites/" + app1.name())
.withApiVersion("2023-01-01")
.withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true))
.create();

//============================================================
// Deploy a web app that connects to the storage account
// Source code: https://github.com/jianghaolu/azure-samples-blob-explorer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.resourcemanager.AzureResourceManager;
import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties;
import com.azure.resourcemanager.appservice.models.FtpsState;
import com.azure.resourcemanager.appservice.models.JavaVersion;
import com.azure.resourcemanager.appservice.models.PricingTier;
import com.azure.resourcemanager.appservice.models.WebApp;
Expand Down Expand Up @@ -111,11 +113,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager, Strin
.withWebContainer(WebContainer.TOMCAT_8_5_NEWEST)
.withAppSetting("AZURE_KEYVAULT_URI", vault.vaultUri())
.withSystemAssignedManagedServiceIdentity()
.withFtpsState(FtpsState.ALL_ALLOWED)
.create();

System.out.println("Created web app " + app.name());
Utils.print(app);

app.manager().resourceManager().genericResources().define("ftp")
.withRegion(app.regionName())
.withExistingResourceGroup(app.resourceGroupName())
.withResourceType("basicPublishingCredentialsPolicies")
.withProviderNamespace("Microsoft.Web")
.withoutPlan()
.withParentResourcePath("sites/" + app.name())
.withApiVersion("2023-01-01")
.withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true))
.create();

//============================================================
// Update vault to allow the web app to access

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import com.azure.core.management.AzureEnvironment;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.resourcemanager.AzureResourceManager;
import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties;
import com.azure.resourcemanager.appservice.models.ConnectionStringType;
import com.azure.resourcemanager.appservice.models.FtpsState;
import com.azure.resourcemanager.appservice.models.JavaVersion;
import com.azure.resourcemanager.appservice.models.PricingTier;
import com.azure.resourcemanager.appservice.models.WebApp;
Expand Down Expand Up @@ -102,11 +104,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) {
.withWebContainer(WebContainer.TOMCAT_8_0_NEWEST)
.withConnectionString("storage.connectionString", connectionString, ConnectionStringType.CUSTOM)
.withAppSetting("storage.containerName", containerName)
.withFtpsState(FtpsState.ALL_ALLOWED)
.create();

System.out.println("Created web app " + app1.name());
Utils.print(app1);

app1.manager().resourceManager().genericResources().define("ftp")
.withRegion(app1.regionName())
.withExistingResourceGroup(app1.resourceGroupName())
.withResourceType("basicPublishingCredentialsPolicies")
.withProviderNamespace("Microsoft.Web")
.withoutPlan()
.withParentResourcePath("sites/" + app1.name())
.withApiVersion("2023-01-01")
.withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true))
.create();

//============================================================
// Deploy a web app that connects to the storage account
// Source code: https://github.com/jianghaolu/azure-samples-blob-explorer
Expand Down