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).
|
api-version
|
query |
True
|
string
|
API Version
|
Responses
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
List Publishing Credentials Policies
Sample request
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);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armappservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b5d78da207e9c5d8f82e95224039867271f47cdf/specification/web/resource-manager/Microsoft.Web/stable/2024-04-01/examples/ListPublishingCredentialsPoliciesSlot.json
func ExampleWebAppsClient_NewListBasicPublishingCredentialsPoliciesSlotPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewWebAppsClient().NewListBasicPublishingCredentialsPoliciesSlotPager("testrg123", "testsite", "staging", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.PublishingCredentialsPoliciesCollection = armappservice.PublishingCredentialsPoliciesCollection{
// Value: []*armappservice.CsmPublishingCredentialsPoliciesEntity{
// {
// Name: to.Ptr("ftp"),
// Type: to.Ptr("Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies"),
// ID: to.Ptr("/subscriptions/3fb8d758-2e2c-42e9-a528-a8acdfe87237/resourceGroups/testrg123/providers/Microsoft.Web/sites/testsite/slots/staging/basicPublishingCredentialsPolicies/ftp"),
// Properties: &armappservice.CsmPublishingCredentialsPoliciesEntityProperties{
// Allow: to.Ptr(true),
// },
// },
// {
// Name: to.Ptr("scm"),
// Type: to.Ptr("Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies"),
// ID: to.Ptr("/subscriptions/3fb8d758-2e2c-42e9-a528-a8acdfe87237/resourceGroups/testrg123/providers/Microsoft.Web/sites/testsite/slots/staging/basicPublishingCredentialsPolicies/scm"),
// Properties: &armappservice.CsmPublishingCredentialsPoliciesEntityProperties{
// Allow: to.Ptr(true),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"id": "/subscriptions/3fb8d758-2e2c-42e9-a528-a8acdfe87237/resourceGroups/testrg123/providers/Microsoft.Web/sites/testsite/slots/staging/basicPublishingCredentialsPolicies/ftp",
"name": "ftp",
"type": "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies",
"properties": {
"allow": true
}
},
{
"id": "/subscriptions/3fb8d758-2e2c-42e9-a528-a8acdfe87237/resourceGroups/testrg123/providers/Microsoft.Web/sites/testsite/slots/staging/basicPublishingCredentialsPolicies/scm",
"name": "scm",
"type": "Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies",
"properties": {
"allow": true
}
}
]
}
Definitions
CsmPublishingCredentialsPoliciesEntity
Object
Publishing Credentials Policies parameters.
Name |
Type |
Description |
id
|
string
|
Resource Id.
|
kind
|
string
|
Kind of resource.
|
name
|
string
|
Resource Name.
|
properties.allow
|
boolean
|
true to allow access to a publishing method; otherwise, false .
|
type
|
string
|
Resource type.
|
DefaultErrorResponse
Object
App Service error response.
Name |
Type |
Description |
error
|
Error
|
Error model.
|
Details
Object
Name |
Type |
Description |
code
|
string
|
Standardized string to programmatically identify the error.
|
message
|
string
|
Detailed error description and debugging information.
|
target
|
string
|
Detailed error description and debugging information.
|
Error
Object
Error model.
Name |
Type |
Description |
code
|
string
|
Standardized string to programmatically identify the error.
|
details
|
Details[]
|
Detailed errors.
|
innererror
|
string
|
More information to debug error.
|
message
|
string
|
Detailed error description and debugging information.
|
target
|
string
|
Detailed error description and debugging information.
|
PublishingCredentialsPoliciesCollection
Object
Publishing Credentials Policies entity collection ARM resource.