Compares a subscriptions logical zone mapping
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/?api-version=2022-12-01
Expand table
Name
In
Required
Type
Description
subscriptionId
path
True
string
The ID of the target subscription.
api-version
query
True
string
The API version to use for this operation.
Expand table
Name
Type
Description
location
string
The Microsoft location.
subscriptionIds
string[]
The peer Microsoft Azure subscription ID.
Expand table
Name
Type
Description
200 OK
CheckZonePeersResult
OK - Returns information about the logical availability zone mapping between subscriptions
Other Status Codes
ErrorResponse
Error response describing why the operation failed.
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Expand table
Name
Description
user_impersonation
impersonate your user account
Sample request
POST https://management.azure.com/subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/providers/Microsoft.Resources/checkZonePeers/?api-version=2022-12-01
{
"location": "eastus",
"subscriptionIds": [
"subscriptions/11111111-1111-1111-1111-111111111111"
]
}
import com.azure.resourcemanager.resources.models.CheckZonePeersRequest;
import java.util.Arrays;
/**
* Samples for Subscriptions CheckZonePeers.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/examples/PostCheckZonePeers.json
*/
/**
* Sample code: GetLogicalZoneMapping.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getLogicalZoneMapping(com.azure.resourcemanager.AzureResourceManager azure) {
azure.genericResources().manager().subscriptionClient().getSubscriptions().checkZonePeersWithResponse(
"8d65815f-a5b6-402f-9298-045155da7d74", new CheckZonePeersRequest().withLocation("eastus")
.withSubscriptionIds(Arrays.asList("subscriptions/11111111-1111-1111-1111-111111111111")),
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.resource import SubscriptionClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource
# USAGE
python post_check_zone_peers.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 = SubscriptionClient(
credential=DefaultAzureCredential(),
)
response = client.subscriptions.check_zone_peers(
subscription_id="8d65815f-a5b6-402f-9298-045155da7d74",
parameters={"location": "eastus", "subscriptionIds": ["subscriptions/11111111-1111-1111-1111-111111111111"]},
)
print(response)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/examples/PostCheckZonePeers.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 armsubscriptions_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4f4073bdb028bc84bc3e6405c1cbaf8e89b83caf/specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/examples/PostCheckZonePeers.json
func ExampleClient_CheckZonePeers() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsubscriptions.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewClient().CheckZonePeers(ctx, "8d65815f-a5b6-402f-9298-045155da7d74", armsubscriptions.CheckZonePeersRequest{
Location: to.Ptr("eastus"),
SubscriptionIDs: []*string{
to.Ptr("subscriptions/11111111-1111-1111-1111-111111111111")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CheckZonePeersResult = armsubscriptions.CheckZonePeersResult{
// AvailabilityZonePeers: []*armsubscriptions.AvailabilityZonePeers{
// {
// AvailabilityZone: to.Ptr("1"),
// Peers: []*armsubscriptions.Peers{
// {
// AvailabilityZone: to.Ptr("3"),
// SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// },
// {
// AvailabilityZone: to.Ptr("2"),
// Peers: []*armsubscriptions.Peers{
// {
// AvailabilityZone: to.Ptr("2"),
// SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// },
// {
// AvailabilityZone: to.Ptr("3"),
// Peers: []*armsubscriptions.Peers{
// {
// AvailabilityZone: to.Ptr("1"),
// SubscriptionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// }},
// Location: to.Ptr("eastus2"),
// SubscriptionID: to.Ptr("8d65815f-a5b6-402f-9298-045155da7d74"),
// }
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
const { SubscriptionClient } = require("@azure/arm-resources-subscriptions");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Compares a subscriptions logical zone mapping
*
* @summary Compares a subscriptions logical zone mapping
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/examples/PostCheckZonePeers.json
*/
async function getLogicalZoneMapping() {
const subscriptionId = "8d65815f-a5b6-402f-9298-045155da7d74";
const parameters = {
location: "eastus",
subscriptionIds: ["subscriptions/11111111-1111-1111-1111-111111111111"],
};
const credential = new DefaultAzureCredential();
const client = new SubscriptionClient(credential);
const result = await client.subscriptions.checkZonePeers(subscriptionId, parameters);
console.log(result);
}
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
{
"subscriptionId": "8d65815f-a5b6-402f-9298-045155da7d74",
"location": "eastus2",
"availabilityZonePeers": [
{
"availabilityZone": "1",
"peers": [
{
"subscriptionId": "11111111-1111-1111-1111-111111111111",
"availabilityZone": "3"
}
]
},
{
"availabilityZone": "2",
"peers": [
{
"subscriptionId": "11111111-1111-1111-1111-111111111111",
"availabilityZone": "2"
}
]
},
{
"availabilityZone": "3",
"peers": [
{
"subscriptionId": "11111111-1111-1111-1111-111111111111",
"availabilityZone": "1"
}
]
}
]
}
Expand table
List of availability zones shared by the subscriptions.
Expand table
Name
Type
Description
availabilityZone
string
The availabilityZone.
peers
Peers []
Details of shared availability zone.
Check zone peers request parameters.
Expand table
Name
Type
Description
location
string
The Microsoft location.
subscriptionIds
string[]
The peer Microsoft Azure subscription ID.
Result of the Check zone peers operation.
Expand table
Name
Type
Description
availabilityZonePeers
AvailabilityZonePeers []
The Availability Zones shared by the subscriptions.
location
string
the location of the subscription.
subscriptionId
string
The subscription ID.
The resource management error additional info.
Expand table
Name
Type
Description
info
object
The additional info.
type
string
The additional info type.
The error detail.
Expand table
Name
Type
Description
additionalInfo
ErrorAdditionalInfo []
The error additional info.
code
string
The error code.
details
ErrorDetail []
The error details.
message
string
The error message.
target
string
The error target.
Error response
Expand table
Name
Type
Description
error
ErrorDetail
The error object.
Information about shared availability zone.
Expand table
Name
Type
Description
availabilityZone
string
The availabilityZone.
subscriptionId
string
The subscription ID.