diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java index 5f3527fecc320..33fe365d46361 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java @@ -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; @@ -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 diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java index 8b34ccf121387..a78db8be5581c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java @@ -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; @@ -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 diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java index c5522a09e7a20..20a4f2e38d7a4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java @@ -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; @@ -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 diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java index 48d562d80c09d..9647f8062963b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java @@ -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; @@ -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