Web Apps - List Basic Publishing Credentials Policies Slot
Reference
Service:
App Service
API Version:
2024-04-01
Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies?api-version=2024-04-01
URI Parameters
Name
In
Required
Type
Description
name
path
True
string
Name of the app.
resourceGroupName
path
True
string
Name of the resource group to which the resource belongs.
Regex pattern: ^[-\w\._\(\)]+[^\.]$
slot
path
True
string
subscriptionId
path
True
string
Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
GET https://management.azure.com/subscriptions/3fb8d758-2e2c-42e9-a528-a8acdfe87237/resourceGroups/testrg123/providers/Microsoft.Web/sites/testsite/slots/staging/basicPublishingCredentialsPolicies?api-version=2024-04-01
/**
* Samples for WebApps ListBasicPublishingCredentialsPoliciesSlot.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListPublishingCredentialsPoliciesSlot
* .json
*/
/**
* Sample code: List Publishing Credentials Policies.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listPublishingCredentialsPolicies(com.azure.resourcemanager.AzureResourceManager azure) {
azure.webApps().manager().serviceClient().getWebApps().listBasicPublishingCredentialsPoliciesSlot("testrg123",
"testsite", "staging", com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.web import WebSiteManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-web
# USAGE
python list_publishing_credentials_policies_slot.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = WebSiteManagementClient(
credential=DefaultAzureCredential(),
subscription_id="3fb8d758-2e2c-42e9-a528-a8acdfe87237",
)
response = client.web_apps.list_basic_publishing_credentials_policies_slot(
resource_group_name="testrg123",
name="testsite",
slot="staging",
)
for item in response:
print(item)
# x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListPublishingCredentialsPoliciesSlot.json
if __name__ == "__main__":
main()
const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site.
*
* @summary Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site.
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListPublishingCredentialsPoliciesSlot.json
*/
async function listPublishingCredentialsPolicies() {
const subscriptionId =
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "3fb8d758-2e2c-42e9-a528-a8acdfe87237";
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
const name = "testsite";
const slot = "staging";
const credential = new DefaultAzureCredential();
const client = new WebSiteManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.webApps.listBasicPublishingCredentialsPoliciesSlot(
resourceGroupName,
name,
slot,
)) {
resArray.push(item);
}
console.log(resArray);
}