Rufen Sie die Defender-Tarifkonfigurationen des ausgewählten Bereichs ab (gültige Bereiche sind Ressourcen-ID oder Abonnement-ID). Auf Ressourcenebene werden "VirtualMachines", "VMSS" und "ARC-Computer" unterstützt.
GET https://management.azure.com/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}?api-version=2024-01-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
pricingName
|
path |
True
|
string
|
Name der Preiskonfiguration
|
scopeId
|
path |
True
|
string
|
Die Bereichs-ID der Preise. Gültige Bereiche sind: Abonnement (Format: 'subscriptions/{subscriptionId}') oder eine bestimmte Ressource (Format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName})) – Unterstützte Ressourcen sind (VirtualMachines)
|
api-version
|
query |
True
|
string
|
API-Version für den Vorgang
|
Antworten
Name |
Typ |
Beschreibung |
200 OK
|
Pricing
|
OK
|
Other Status Codes
|
CloudError
|
Fehlerantwort mit Beschreibung des Grunds für den Fehler.
|
Sicherheit
azure_auth
Azure Active Directory-OAuth2-Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Beschreibung |
user_impersonation
|
Identitätswechsel Ihres Benutzerkontos
|
Beispiele
Get pricings on resource - VirtualMachines plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetResourcePricingByNameVirtualMachines_example.json
func ExamplePricingsClient_Get_getPricingsOnResourceVirtualMachinesPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "VirtualMachines", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("VirtualMachines"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// Inherited: to.Ptr(armsecurity.InheritedTrue),
// InheritedFrom: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// SubPlan: to.Ptr("P2"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("MdeDesignatedSubscription"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetResourcePricingByNameVirtualMachines_example.json
*/
async function getPricingsOnResourceVirtualMachinesPlan() {
const scopeId =
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1";
const pricingName = "VirtualMachines";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines",
"name": "VirtualMachines",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "P2",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"inherited": "True",
"inheritedFrom": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]"
}
},
{
"name": "MdeDesignatedSubscription",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - CloudPosture plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionCloudPosturePlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("CloudPosture"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("AgentlessDiscoveryForKubernetes"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("SensitiveDataDiscovery"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("EntraPermissionsManagement"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json
*/
async function getPricingsOnSubscriptionCloudPosturePlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "CloudPosture";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture",
"name": "CloudPosture",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[]"
}
},
{
"name": "AgentlessDiscoveryForKubernetes",
"isEnabled": "True"
},
{
"name": "SensitiveDataDiscovery",
"isEnabled": "True"
},
{
"name": "ContainerRegistriesVulnerabilityAssessments",
"isEnabled": "True"
},
{
"name": "EntraPermissionsManagement",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - Containers plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameContainers_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionContainersPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("Containers"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameContainers_example.json
*/
async function getPricingsOnSubscriptionContainersPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "Containers";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers",
"name": "Containers",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "ContainerRegistriesVulnerabilityAssessments",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - Dns plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameDns_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionDnsPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("Dns"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns"),
// Properties: &armsecurity.PricingProperties{
// Deprecated: to.Ptr(true),
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ReplacedBy: []*string{
// to.Ptr("VirtualMachines")},
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameDns_example.json
*/
async function getPricingsOnSubscriptionDnsPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "Dns";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns",
"name": "Dns",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"deprecated": true,
"replacedBy": [
"VirtualMachines"
],
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered"
}
}
Get pricings on subscription - StorageAccounts plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionStorageAccountsPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("StorageAccounts"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// SubPlan: to.Ptr("PerStorageAccount"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("OnUploadMalwareScanning"),
// AdditionalExtensionProperties: map[string]any{
// "capGBPerMonthPerStorageAccount": float64(10),
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("SensitiveDataDiscovery"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json
*/
async function getPricingsOnSubscriptionStorageAccountsPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "StorageAccounts";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts",
"name": "StorageAccounts",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "PerStorageAccount",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "OnUploadMalwareScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"capGBPerMonthPerStorageAccount": 10
}
},
{
"name": "SensitiveDataDiscovery",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - VirtualMachines plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionVirtualMachinesPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("VirtualMachines"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusPartiallyCovered),
// SubPlan: to.Ptr("P2"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("MdeDesignatedSubscription"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json
*/
async function getPricingsOnSubscriptionVirtualMachinesPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "VirtualMachines";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines",
"name": "VirtualMachines",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "P2",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "PartiallyCovered",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]"
}
},
{
"name": "MdeDesignatedSubscription",
"isEnabled": "True"
}
]
}
}
Definitionen
Name |
Beschreibung |
CloudError
|
Allgemeine Fehlerantwort für alle Azure Resource Manager-APIs, zur Rückgabe von Fehlerdetails für fehlgeschlagene Vorgänge. (Dies folgt auch dem OData-Fehlerantwortformat.)
|
CloudErrorBody
|
Die Fehlerdetails.
|
code
|
Der Vorgang status Code.
|
enforce
|
Wenn dieser Wert auf "False" festgelegt ist, können die Nachfolger dieses Bereichs die für diesen Bereich festgelegte Preiskonfiguration überschreiben (ermöglicht die Einstellung inherited="False"). Wenn dieser Wert auf "True" festgelegt ist, verhindert er Außerkraftsetzungen und erzwingt diese Preiskonfiguration für alle Nachfolger dieses Bereichs. Dieses Feld ist nur für Preise auf Abonnementebene verfügbar.
|
ErrorAdditionalInfo
|
Zusätzliche Informationen zum Ressourcenverwaltungsfehler.
|
Extension
|
Erweiterungseigenschaften eines Plans
|
inherited
|
"inherited" = "True" gibt an, dass der aktuelle Bereich seine Preiskonfiguration vom übergeordneten Bereich erbt. Die ID des übergeordneten Bereichs, der die geerbte Konfiguration bereitstellt, wird im Feld "inheritedFrom" angezeigt. Auf der anderen Seite gibt "inherited" = "False" an, dass der aktuelle Bereich seine eigene Preiskonfiguration explizit festgelegt hat und nicht von seinem übergeordneten Element erbt. Dieses Feld ist schreibgeschützt und nur für Preise auf Ressourcenebene verfügbar.
|
isEnabled
|
Gibt an, ob die Erweiterung aktiviert ist.
|
OperationStatus
|
Eine status, die den Erfolg/Fehler des Aktivierungs-/Deaktivierungsvorgangs der Erweiterung beschreibt.
|
Pricing
|
Microsoft Defender für Cloud wird in zwei Tarifen bereitgestellt: free und standard. Der Standard-Tarif bietet erweiterte Sicherheitsfunktionen, während der free-Tarif grundlegende Sicherheitsfeatures bietet.
|
pricingTier
|
Gibt an, ob der Defender-Plan für den ausgewählten Bereich aktiviert ist. Microsoft Defender für Cloud wird in zwei Tarifen bereitgestellt: free und standard. Der Standard-Tarif bietet erweiterte Sicherheitsfunktionen, während der free-Tarif grundlegende Sicherheitsfeatures bietet.
|
resourcesCoverageStatus
|
Dieses Feld ist nur auf Abonnementebene verfügbar und spiegelt die Abdeckung status der Ressourcen unter dem Abonnement wider. Hinweis: Das Feld "pricingTier" gibt den Plan status des Abonnements an. Da der Plan status jedoch auch auf Ressourcenebene definiert werden kann, kann es zu einer Fehlausrichtung zwischen dem Plan des Abonnements status und der status ressource kommen. Dieses Feld gibt die Abdeckung status der Ressourcen an.
|
CloudError
Allgemeine Fehlerantwort für alle Azure Resource Manager-APIs, zur Rückgabe von Fehlerdetails für fehlgeschlagene Vorgänge. (Dies folgt auch dem OData-Fehlerantwortformat.)
Name |
Typ |
Beschreibung |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Fehlerinformationen.
|
error.code
|
string
|
Der Fehlercode.
|
error.details
|
CloudErrorBody[]
|
Die Fehlerdetails.
|
error.message
|
string
|
Die Fehlermeldung.
|
error.target
|
string
|
Das Fehlerziel.
|
CloudErrorBody
Die Fehlerdetails.
Name |
Typ |
Beschreibung |
additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Fehlerinformationen.
|
code
|
string
|
Der Fehlercode.
|
details
|
CloudErrorBody[]
|
Die Fehlerdetails.
|
message
|
string
|
Die Fehlermeldung.
|
target
|
string
|
Das Fehlerziel.
|
code
Der Vorgang status Code.
Name |
Typ |
Beschreibung |
Failed
|
string
|
Die Erweiterung wurde nicht erfolgreich erstellt/aktualisiert. Weitere Informationen finden Sie unter Vorgang status Meldung.
|
Succeeded
|
string
|
Die Erweiterung wurde erfolgreich erstellt/aktualisiert.
|
enforce
Wenn dieser Wert auf "False" festgelegt ist, können die Nachfolger dieses Bereichs die für diesen Bereich festgelegte Preiskonfiguration überschreiben (ermöglicht die Einstellung inherited="False"). Wenn dieser Wert auf "True" festgelegt ist, verhindert er Außerkraftsetzungen und erzwingt diese Preiskonfiguration für alle Nachfolger dieses Bereichs. Dieses Feld ist nur für Preise auf Abonnementebene verfügbar.
Name |
Typ |
Beschreibung |
False
|
string
|
Ermöglicht es den Nachfolgern dieses Bereichs, die für diesen Bereich festgelegte Preiskonfiguration außer Kraft zu setzen (ermöglicht die Einstellung inherited="False")
|
True
|
string
|
Verhindert Außerkraftsetzungen und erzwingt die Preiskonfiguration des aktuellen Bereichs für alle Nachfolger
|
ErrorAdditionalInfo
Zusätzliche Informationen zum Ressourcenverwaltungsfehler.
Name |
Typ |
Beschreibung |
info
|
object
|
Zusätzliche Informationen.
|
type
|
string
|
Typ der zusätzlichen Informationen.
|
Extension
Erweiterungseigenschaften eines Plans
Name |
Typ |
Beschreibung |
additionalExtensionProperties
|
|
Eigenschaftenwerte, die der Erweiterung zugeordnet sind.
|
isEnabled
|
isEnabled
|
Gibt an, ob die Erweiterung aktiviert ist.
|
name
|
string
|
Der Erweiterungsname. Diese Werte werden unterstützt:
AgentlessDiscoveryForKubernetes : API-basierte Ermittlung von Informationen zur Kubernetes-Clusterarchitektur, zu Workloadobjekten und zur Einrichtung. Erforderlich für Kubernetes-Bestand, Identitäts- und Netzwerkexpositionserkennung, Angriffspfadanalyse und Risikosuche als Teil des CloudSicherheits-Explorers.
Verfügbar für Den CloudPosture-Plan.
OnUploadMalwareScanning: Schränkt die pro Monat zu scannenden GB für jedes Speicherkonto innerhalb des Abonnements ein. Sobald dieser Grenzwert für ein bestimmtes Speicherkonto erreicht wurde, werden Blobs während des aktuellen Kalendermonats nicht mehr überprüft.
Verfügbar für StorageAccounts-Plan.
SensitiveDataDiscovery : Bei der Ermittlung vertraulicher Daten werden Blob Storage-Container mit vertraulichen Daten wie Anmeldeinformationen, Kreditkarten usw. identifiziert, um Sicherheitsereignisse zu priorisieren und zu untersuchen.
Verfügbar für StorageAccounts- und CloudPosture-Pläne.
ContainerRegistriesVulnerabilityAssessments : Ermöglicht die Verwaltung von Sicherheitsrisiken für Images, die in Ihren Containerregistrierungen gespeichert sind.
Verfügbar für CloudPosture- und Containerpläne.
|
operationStatus
|
OperationStatus
|
Optional. Eine status, die den Erfolg/Fehler des Aktivierungs-/Deaktivierungsvorgangs der Erweiterung beschreibt.
|
inherited
"inherited" = "True" gibt an, dass der aktuelle Bereich seine Preiskonfiguration vom übergeordneten Bereich erbt. Die ID des übergeordneten Bereichs, der die geerbte Konfiguration bereitstellt, wird im Feld "inheritedFrom" angezeigt. Auf der anderen Seite gibt "inherited" = "False" an, dass der aktuelle Bereich seine eigene Preiskonfiguration explizit festgelegt hat und nicht von seinem übergeordneten Element erbt. Dieses Feld ist schreibgeschützt und nur für Preise auf Ressourcenebene verfügbar.
Name |
Typ |
Beschreibung |
False
|
string
|
Gibt an, dass der aktuelle Bereich seine eigene Preiskonfiguration festlegt und nicht vom übergeordneten Bereich erbt.
|
True
|
string
|
Gibt an, dass der aktuelle Bereich seine Preiskonfiguration vom übergeordneten Bereich erbt.
|
isEnabled
Gibt an, ob die Erweiterung aktiviert ist.
Name |
Typ |
Beschreibung |
False
|
string
|
Gibt an, dass die Erweiterung deaktiviert ist.
|
True
|
string
|
Gibt an, dass die Erweiterung aktiviert ist.
|
OperationStatus
Eine status, die den Erfolg/Fehler des Aktivierungs-/Deaktivierungsvorgangs der Erweiterung beschreibt.
Name |
Typ |
Beschreibung |
code
|
code
|
Der Vorgang status Code.
|
message
|
string
|
Zusätzliche Informationen zum Erfolg/Misserfolg des Vorgangs.
|
Pricing
Microsoft Defender für Cloud wird in zwei Tarifen bereitgestellt: free und standard. Der Standard-Tarif bietet erweiterte Sicherheitsfunktionen, während der free-Tarif grundlegende Sicherheitsfeatures bietet.
Name |
Typ |
Beschreibung |
id
|
string
|
Ressourcen-ID
|
name
|
string
|
Ressourcenname
|
properties.deprecated
|
boolean
|
Optional. True, wenn der Plan veraltet ist. Wenn ersatzende Pläne vorhanden sind, werden sie in der replacedBy Eigenschaft angezeigt.
|
properties.enablementTime
|
string
|
Optional. Wenn pricingTier ist Standard , enthält diese Eigenschaft das Datum des letzten Festlegens auf pricingTier Standard , wenn verfügbar (z. B. 2023-03-01T12:42:42.1921106Z).
|
properties.enforce
|
enforce
|
Wenn dieser Wert auf "False" festgelegt ist, können die Nachfolger dieses Bereichs die für diesen Bereich festgelegte Preiskonfiguration überschreiben (ermöglicht die Einstellung inherited="False"). Wenn dieser Wert auf "True" festgelegt ist, verhindert er Außerkraftsetzungen und erzwingt diese Preiskonfiguration für alle Nachfolger dieses Bereichs. Dieses Feld ist nur für Preise auf Abonnementebene verfügbar.
|
properties.extensions
|
Extension[]
|
Optional. Liste der erweiterungen, die unter einem Plan angeboten werden.
|
properties.freeTrialRemainingTime
|
string
|
Die dauer für den kostenlosen Testzeitraum für Abonnements – im ISO 8601-Format (z. B. P3Y6M4DT12H30M5S).
|
properties.inherited
|
inherited
|
"inherited" = "True" gibt an, dass der aktuelle Bereich seine Preiskonfiguration vom übergeordneten Bereich erbt. Die ID des übergeordneten Bereichs, der die geerbte Konfiguration bereitstellt, wird im Feld "inheritedFrom" angezeigt. Auf der anderen Seite gibt "inherited" = "False" an, dass der aktuelle Bereich seine eigene Preiskonfiguration explizit festgelegt hat und nicht von seinem übergeordneten Element erbt. Dieses Feld ist schreibgeschützt und nur für Preise auf Ressourcenebene verfügbar.
|
properties.inheritedFrom
|
string
|
Die ID des Bereichs, von dem geerbt wird. "Null", wenn nicht geerbt. Dieses Feld ist nur für Preise auf Ressourcenebene verfügbar.
|
properties.pricingTier
|
pricingTier
|
Gibt an, ob der Defender-Plan für den ausgewählten Bereich aktiviert ist. Microsoft Defender für Cloud wird in zwei Tarifen bereitgestellt: free und standard. Der Standard-Tarif bietet erweiterte Sicherheitsfunktionen, während der free-Tarif grundlegende Sicherheitsfeatures bietet.
|
properties.replacedBy
|
string[]
|
Optional. Liste der Pläne, die diesen Plan ersetzen. Diese Eigenschaft ist nur vorhanden, wenn dieser Plan veraltet ist.
|
properties.resourcesCoverageStatus
|
resourcesCoverageStatus
|
Dieses Feld ist nur auf Abonnementebene verfügbar und spiegelt die Abdeckung status der Ressourcen unter dem Abonnement wider. Hinweis: Das Feld "pricingTier" gibt den Plan status des Abonnements an. Da der Plan status jedoch auch auf Ressourcenebene definiert werden kann, kann es zu einer Fehlausrichtung zwischen dem Plan des Abonnements status und der status ressource kommen. Dieses Feld gibt die Abdeckung status der Ressourcen an.
|
properties.subPlan
|
string
|
Der für eine Standardpreiskonfiguration ausgewählte Unterplan, wenn mehr als ein Unterplan verfügbar ist. Jeder Unterplan ermöglicht eine Reihe von Sicherheitsfeatures. Wenn nicht angegeben, wird der vollständige Plan angewendet. Für den VirtualMachines-Plan sind "P1" & "P2" verfügbar, wobei für Ressourcenebene nur der Unterplan "P1" unterstützt wird.
|
type
|
string
|
Ressourcentyp
|
pricingTier
Gibt an, ob der Defender-Plan für den ausgewählten Bereich aktiviert ist. Microsoft Defender für Cloud wird in zwei Tarifen bereitgestellt: free und standard. Der Standard-Tarif bietet erweiterte Sicherheitsfunktionen, während der free-Tarif grundlegende Sicherheitsfeatures bietet.
Name |
Typ |
Beschreibung |
Free
|
string
|
Kostenlose Microsoft Defender für cloudbasierte Funktionen mit grundlegenden Sicherheitsfeatures
|
Standard
|
string
|
Nutzen Sie die standardbasierte Microsoft Defender für Cloud mit erweiterten Sicherheitsfeatures.
|
resourcesCoverageStatus
Dieses Feld ist nur auf Abonnementebene verfügbar und spiegelt die Abdeckung status der Ressourcen unter dem Abonnement wider. Hinweis: Das Feld "pricingTier" gibt den Plan status des Abonnements an. Da der Plan status jedoch auch auf Ressourcenebene definiert werden kann, kann es zu einer Fehlausrichtung zwischen dem Plan des Abonnements status und der status ressource kommen. Dieses Feld gibt die Abdeckung status der Ressourcen an.
Name |
Typ |
Beschreibung |
FullyCovered
|
string
|
Dieser Wert gibt an, dass für alle Dem Abonnement zugeordneten Ressourcen der Defender-Plan aktiviert ist.
|
NotCovered
|
string
|
Dieser Wert gibt an, dass der Defender-Plan für alle Ressourcen im Abonnement deaktiviert ist. Keine der Ressourcen wird durch den Defender-Plan geschützt.
|
PartiallyCovered
|
string
|
Dieser Wert gibt an, dass für einige Ressourcen unter dem Abonnement der Defender-Plan aktiviert ist, während für andere Ressourcen er deaktiviert ist. Es gibt eine gemischte Abdeckung status unter den Ressourcen.
|