Tworzy lub aktualizuje magazyn usługi Recovery Services.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}?api-version=2023-04-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów. W nazwie jest uwzględniana wielkość liter.
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji docelowej.
|
vaultName
|
path |
True
|
string
|
Nazwa magazynu usługi Recovery Services.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
Treść żądania
Nazwa |
Wymagane |
Typ |
Opis |
location
|
True
|
string
|
Lokalizacja zasobu.
|
etag
|
|
string
|
Opcjonalny element ETag.
|
identity
|
|
IdentityData
|
Tożsamość zasobu.
|
properties
|
|
VaultProperties
|
Właściwości magazynu.
|
sku
|
|
Sku
|
Określa unikatowy identyfikator systemowy dla poszczególnych zasobów platformy Azure.
|
tags
|
|
object
|
Tagi zasobów.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
Vault
|
OK
|
201 Created
|
Vault
|
Utworzone
|
Other Status Codes
|
CloudError
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikuj konto użytkownika.
|
Przykłady
Create or Update Recovery Services vault
Sample Request
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2023-04-01
{
"properties": {
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"location": "West US",
"identity": {
"type": "SystemAssigned"
}
}
import com.azure.resourcemanager.recoveryservices.models.IdentityData;
import com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType;
import com.azure.resourcemanager.recoveryservices.models.Sku;
import com.azure.resourcemanager.recoveryservices.models.SkuName;
import com.azure.resourcemanager.recoveryservices.models.VaultProperties;
import java.util.HashMap;
import java.util.Map;
/** Samples for Vaults CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.json
*/
/**
* Sample code: Create or Update Recovery Services vault.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateRecoveryServicesVault(
com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) {
manager
.vaults()
.define("swaggerExample")
.withRegion("West US")
.withExistingResourceGroup("Default-RecoveryServices-ResourceGroup")
.withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
.withProperties(new VaultProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED))
.withSku(new Sku().withName(SkuName.STANDARD))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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.recoveryservices import RecoveryServicesClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservices
# USAGE
python put_vault.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 = RecoveryServicesClient(
credential=DefaultAzureCredential(),
subscription_id="77777777-b0c6-47a2-b37c-d8e65a629c18",
)
response = client.vaults.begin_create_or_update(
resource_group_name="Default-RecoveryServices-ResourceGroup",
vault_name="swaggerExample",
vault={
"identity": {"type": "SystemAssigned"},
"location": "West US",
"properties": {"publicNetworkAccess": "Enabled"},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.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 armrecoveryservices_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/recoveryservices/armrecoveryservices"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateRecoveryServicesVault() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "Default-RecoveryServices-ResourceGroup", "swaggerExample", armrecoveryservices.Vault{
Location: to.Ptr("West US"),
Identity: &armrecoveryservices.IdentityData{
Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeSystemAssigned),
},
Properties: &armrecoveryservices.VaultProperties{
PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Vault = armrecoveryservices.Vault{
// Name: to.Ptr("swaggerExample"),
// Type: to.Ptr("Microsoft.RecoveryServices/vaults"),
// Etag: to.Ptr("W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\""),
// ID: to.Ptr("/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "TestUpdatedKey": to.Ptr("TestUpdatedValue"),
// },
// Identity: &armrecoveryservices.IdentityData{
// Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("3137d6c7-5d6c-411c-b934-7a2a729ee247"),
// TenantID: to.Ptr("d676e86e-2206-4a7c-999c-ece52c144b5b"),
// },
// Properties: &armrecoveryservices.VaultProperties{
// ProvisioningState: to.Ptr("Succeeded"),
// PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
// },
// SKU: &armrecoveryservices.SKU{
// Name: to.Ptr(armrecoveryservices.SKUNameRS0),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { RecoveryServicesClient } = require("@azure/arm-recoveryservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a Recovery Services vault.
*
* @summary Creates or updates a Recovery Services vault.
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.json
*/
async function createOrUpdateRecoveryServicesVault() {
const subscriptionId =
process.env["RECOVERYSERVICES_SUBSCRIPTION_ID"] || "77777777-b0c6-47a2-b37c-d8e65a629c18";
const resourceGroupName =
process.env["RECOVERYSERVICES_RESOURCE_GROUP"] || "Default-RecoveryServices-ResourceGroup";
const vaultName = "swaggerExample";
const vault = {
identity: { type: "SystemAssigned" },
location: "West US",
properties: { publicNetworkAccess: "Enabled" },
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new RecoveryServicesClient(credential, subscriptionId);
const result = await client.vaults.beginCreateOrUpdateAndWait(
resourceGroupName,
vaultName,
vault
);
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.RecoveryServices;
using Azure.ResourceManager.RecoveryServices.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault.json
// this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18";
string resourceGroupName = "Default-RecoveryServices-ResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this RecoveryServicesVaultResource
RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults();
// invoke the operation
string vaultName = "swaggerExample";
RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
Properties = new RecoveryServicesVaultProperties()
{
PublicNetworkAccess = VaultPublicNetworkAccess.Enabled,
},
Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard),
};
ArmOperation<RecoveryServicesVaultResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data);
RecoveryServicesVaultResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
RecoveryServicesVaultData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"type": "SystemAssigned"
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded"
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "RS0",
"tier": "Standard"
}
}
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"type": "SystemAssigned"
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded"
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "RS0",
"tier": "Standard"
}
}
Create or Update Vault with CustomerManagedKeys
Sample Request
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2023-04-01
{
"properties": {
"publicNetworkAccess": "Enabled",
"encryption": {
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
},
"kekIdentity": {
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"infrastructureEncryption": "Enabled"
}
},
"sku": {
"name": "Standard"
},
"location": "West US",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
}
}
import com.azure.resourcemanager.recoveryservices.models.CmkKekIdentity;
import com.azure.resourcemanager.recoveryservices.models.CmkKeyVaultProperties;
import com.azure.resourcemanager.recoveryservices.models.IdentityData;
import com.azure.resourcemanager.recoveryservices.models.InfrastructureEncryptionState;
import com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType;
import com.azure.resourcemanager.recoveryservices.models.Sku;
import com.azure.resourcemanager.recoveryservices.models.SkuName;
import com.azure.resourcemanager.recoveryservices.models.UserIdentity;
import com.azure.resourcemanager.recoveryservices.models.VaultProperties;
import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesEncryption;
import java.util.HashMap;
import java.util.Map;
/** Samples for Vaults CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.json
*/
/**
* Sample code: Create or Update Vault with CustomerManagedKeys.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultWithCustomerManagedKeys(
com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) {
manager
.vaults()
.define("swaggerExample")
.withRegion("West US")
.withExistingResourceGroup("Default-RecoveryServices-ResourceGroup")
.withIdentity(
new IdentityData()
.withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(
mapOf(
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi",
new UserIdentity())))
.withProperties(
new VaultProperties()
.withEncryption(
new VaultPropertiesEncryption()
.withKeyVaultProperties(new CmkKeyVaultProperties().withKeyUri("fakeTokenPlaceholder"))
.withKekIdentity(
new CmkKekIdentity()
.withUserAssignedIdentity(
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"))
.withInfrastructureEncryption(InfrastructureEncryptionState.ENABLED))
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED))
.withSku(new Sku().withName(SkuName.STANDARD))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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.recoveryservices import RecoveryServicesClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservices
# USAGE
python put_vault_with_cmk.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 = RecoveryServicesClient(
credential=DefaultAzureCredential(),
subscription_id="77777777-b0c6-47a2-b37c-d8e65a629c18",
)
response = client.vaults.begin_create_or_update(
resource_group_name="Default-RecoveryServices-ResourceGroup",
vault_name="swaggerExample",
vault={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
},
},
"location": "West US",
"properties": {
"encryption": {
"infrastructureEncryption": "Enabled",
"kekIdentity": {
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
},
},
"publicNetworkAccess": "Enabled",
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.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 armrecoveryservices_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/recoveryservices/armrecoveryservices"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultWithCustomerManagedKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "Default-RecoveryServices-ResourceGroup", "swaggerExample", armrecoveryservices.Vault{
Location: to.Ptr("West US"),
Identity: &armrecoveryservices.IdentityData{
Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armrecoveryservices.UserIdentity{
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {},
},
},
Properties: &armrecoveryservices.VaultProperties{
Encryption: &armrecoveryservices.VaultPropertiesEncryption{
InfrastructureEncryption: to.Ptr(armrecoveryservices.InfrastructureEncryptionStateEnabled),
KekIdentity: &armrecoveryservices.CmkKekIdentity{
UserAssignedIdentity: to.Ptr("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"),
},
KeyVaultProperties: &armrecoveryservices.CmkKeyVaultProperties{
KeyURI: to.Ptr("https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"),
},
},
PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Vault = armrecoveryservices.Vault{
// Name: to.Ptr("swaggerExample"),
// Type: to.Ptr("Microsoft.RecoveryServices/vaults"),
// Etag: to.Ptr("W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\""),
// ID: to.Ptr("/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "TestUpdatedKey": to.Ptr("TestUpdatedValue"),
// },
// Identity: &armrecoveryservices.IdentityData{
// Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armrecoveryservices.UserIdentity{
// "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": &armrecoveryservices.UserIdentity{
// ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
// PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"),
// },
// },
// },
// Properties: &armrecoveryservices.VaultProperties{
// Encryption: &armrecoveryservices.VaultPropertiesEncryption{
// InfrastructureEncryption: to.Ptr(armrecoveryservices.InfrastructureEncryptionStateEnabled),
// KekIdentity: &armrecoveryservices.CmkKekIdentity{
// UseSystemAssignedIdentity: to.Ptr(false),
// UserAssignedIdentity: to.Ptr("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"),
// },
// KeyVaultProperties: &armrecoveryservices.CmkKeyVaultProperties{
// KeyURI: to.Ptr("https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
// },
// SKU: &armrecoveryservices.SKU{
// Name: to.Ptr(armrecoveryservices.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { RecoveryServicesClient } = require("@azure/arm-recoveryservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a Recovery Services vault.
*
* @summary Creates or updates a Recovery Services vault.
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.json
*/
async function createOrUpdateVaultWithCustomerManagedKeys() {
const subscriptionId =
process.env["RECOVERYSERVICES_SUBSCRIPTION_ID"] || "77777777-b0c6-47a2-b37c-d8e65a629c18";
const resourceGroupName =
process.env["RECOVERYSERVICES_RESOURCE_GROUP"] || "Default-RecoveryServices-ResourceGroup";
const vaultName = "swaggerExample";
const vault = {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/85bf5e8c30844f42Add2746ebb7e97b2/resourcegroups/defaultrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplemsi":
{},
},
},
location: "West US",
properties: {
encryption: {
infrastructureEncryption: "Enabled",
kekIdentity: {
userAssignedIdentity:
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi",
},
keyVaultProperties: {
keyUri: "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3",
},
},
publicNetworkAccess: "Enabled",
},
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new RecoveryServicesClient(credential, subscriptionId);
const result = await client.vaults.beginCreateOrUpdateAndWait(
resourceGroupName,
vaultName,
vault
);
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.RecoveryServices;
using Azure.ResourceManager.RecoveryServices.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithCMK.json
// this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18";
string resourceGroupName = "Default-RecoveryServices-ResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this RecoveryServicesVaultResource
RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults();
// invoke the operation
string vaultName = "swaggerExample";
RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")] = new UserAssignedIdentity(),
},
},
Properties = new RecoveryServicesVaultProperties()
{
Encryption = new VaultPropertiesEncryption()
{
KeyUri = new Uri("https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"),
KekIdentity = new CmkKekIdentity()
{
UserAssignedIdentity = new ResourceIdentifier("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"),
},
InfrastructureEncryption = InfrastructureEncryptionState.Enabled,
},
PublicNetworkAccess = VaultPublicNetworkAccess.Enabled,
},
Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard),
};
ArmOperation<RecoveryServicesVaultResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data);
RecoveryServicesVaultResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
RecoveryServicesVaultData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {
"clientId": "fbe75b66-01c5-4f87-a220-233af3270436",
"principalId": "075a0ca6-43f6-4434-9abf-c9b1b79f9219"
}
}
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded",
"encryption": {
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
},
"kekIdentity": {
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi",
"useSystemAssignedIdentity": false
},
"infrastructureEncryption": "Enabled"
}
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "Standard"
}
}
Retry-After: 10
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Provisioning",
"encryption": {
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
},
"kekIdentity": {
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi",
"useSystemAssignedIdentity": false
},
"infrastructureEncryption": "Enabled"
}
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "Standard"
}
}
Create or Update Vault With Monitoring Setting
Sample Request
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2023-04-01
{
"properties": {
"publicNetworkAccess": "Enabled",
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllJobFailures": "Enabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled"
}
}
},
"sku": {
"name": "Standard"
},
"location": "West US",
"identity": {
"type": "SystemAssigned"
}
}
import com.azure.resourcemanager.recoveryservices.models.AlertsState;
import com.azure.resourcemanager.recoveryservices.models.AzureMonitorAlertSettings;
import com.azure.resourcemanager.recoveryservices.models.ClassicAlertSettings;
import com.azure.resourcemanager.recoveryservices.models.IdentityData;
import com.azure.resourcemanager.recoveryservices.models.MonitoringSettings;
import com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType;
import com.azure.resourcemanager.recoveryservices.models.Sku;
import com.azure.resourcemanager.recoveryservices.models.SkuName;
import com.azure.resourcemanager.recoveryservices.models.VaultProperties;
import java.util.HashMap;
import java.util.Map;
/** Samples for Vaults CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.json
*/
/**
* Sample code: Create or Update Vault With Monitoring Setting.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultWithMonitoringSetting(
com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) {
manager
.vaults()
.define("swaggerExample")
.withRegion("West US")
.withExistingResourceGroup("Default-RecoveryServices-ResourceGroup")
.withIdentity(new IdentityData().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
.withProperties(
new VaultProperties()
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withMonitoringSettings(
new MonitoringSettings()
.withAzureMonitorAlertSettings(
new AzureMonitorAlertSettings().withAlertsForAllJobFailures(AlertsState.ENABLED))
.withClassicAlertSettings(
new ClassicAlertSettings().withAlertsForCriticalOperations(AlertsState.DISABLED))))
.withSku(new Sku().withName(SkuName.STANDARD))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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.recoveryservices import RecoveryServicesClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservices
# USAGE
python put_vault_with_monitoring_settings.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 = RecoveryServicesClient(
credential=DefaultAzureCredential(),
subscription_id="77777777-b0c6-47a2-b37c-d8e65a629c18",
)
response = client.vaults.begin_create_or_update(
resource_group_name="Default-RecoveryServices-ResourceGroup",
vault_name="swaggerExample",
vault={
"identity": {"type": "SystemAssigned"},
"location": "West US",
"properties": {
"monitoringSettings": {
"azureMonitorAlertSettings": {"alertsForAllJobFailures": "Enabled"},
"classicAlertSettings": {"alertsForCriticalOperations": "Disabled"},
},
"publicNetworkAccess": "Enabled",
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.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 armrecoveryservices_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/recoveryservices/armrecoveryservices"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultWithMonitoringSetting() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "Default-RecoveryServices-ResourceGroup", "swaggerExample", armrecoveryservices.Vault{
Location: to.Ptr("West US"),
Identity: &armrecoveryservices.IdentityData{
Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeSystemAssigned),
},
Properties: &armrecoveryservices.VaultProperties{
MonitoringSettings: &armrecoveryservices.MonitoringSettings{
AzureMonitorAlertSettings: &armrecoveryservices.AzureMonitorAlertSettings{
AlertsForAllJobFailures: to.Ptr(armrecoveryservices.AlertsStateEnabled),
},
ClassicAlertSettings: &armrecoveryservices.ClassicAlertSettings{
AlertsForCriticalOperations: to.Ptr(armrecoveryservices.AlertsStateDisabled),
},
},
PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Vault = armrecoveryservices.Vault{
// Name: to.Ptr("swaggerExample"),
// Type: to.Ptr("Microsoft.RecoveryServices/vaults"),
// Etag: to.Ptr("W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\""),
// ID: to.Ptr("/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "TestUpdatedKey": to.Ptr("TestUpdatedValue"),
// },
// Identity: &armrecoveryservices.IdentityData{
// Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("3137d6c7-5d6c-411c-b934-7a2a729ee247"),
// TenantID: to.Ptr("d676e86e-2206-4a7c-999c-ece52c144b5b"),
// },
// Properties: &armrecoveryservices.VaultProperties{
// MonitoringSettings: &armrecoveryservices.MonitoringSettings{
// AzureMonitorAlertSettings: &armrecoveryservices.AzureMonitorAlertSettings{
// AlertsForAllJobFailures: to.Ptr(armrecoveryservices.AlertsStateEnabled),
// },
// ClassicAlertSettings: &armrecoveryservices.ClassicAlertSettings{
// AlertsForCriticalOperations: to.Ptr(armrecoveryservices.AlertsStateDisabled),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
// },
// SKU: &armrecoveryservices.SKU{
// Name: to.Ptr(armrecoveryservices.SKUNameRS0),
// Tier: to.Ptr("Standard"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { RecoveryServicesClient } = require("@azure/arm-recoveryservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a Recovery Services vault.
*
* @summary Creates or updates a Recovery Services vault.
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.json
*/
async function createOrUpdateVaultWithMonitoringSetting() {
const subscriptionId =
process.env["RECOVERYSERVICES_SUBSCRIPTION_ID"] || "77777777-b0c6-47a2-b37c-d8e65a629c18";
const resourceGroupName =
process.env["RECOVERYSERVICES_RESOURCE_GROUP"] || "Default-RecoveryServices-ResourceGroup";
const vaultName = "swaggerExample";
const vault = {
identity: { type: "SystemAssigned" },
location: "West US",
properties: {
monitoringSettings: {
azureMonitorAlertSettings: { alertsForAllJobFailures: "Enabled" },
classicAlertSettings: { alertsForCriticalOperations: "Disabled" },
},
publicNetworkAccess: "Enabled",
},
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new RecoveryServicesClient(credential, subscriptionId);
const result = await client.vaults.beginCreateOrUpdateAndWait(
resourceGroupName,
vaultName,
vault
);
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.RecoveryServices;
using Azure.ResourceManager.RecoveryServices.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithMonitoringSettings.json
// this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18";
string resourceGroupName = "Default-RecoveryServices-ResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this RecoveryServicesVaultResource
RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults();
// invoke the operation
string vaultName = "swaggerExample";
RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
Properties = new RecoveryServicesVaultProperties()
{
PublicNetworkAccess = VaultPublicNetworkAccess.Enabled,
MonitoringSettings = new VaultMonitoringSettings()
{
AzureMonitorAlertAlertsForAllJobFailures = RecoveryServicesAlertsState.Enabled,
ClassicAlertAlertsForCriticalOperations = RecoveryServicesAlertsState.Disabled,
},
},
Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard),
};
ArmOperation<RecoveryServicesVaultResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data);
RecoveryServicesVaultResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
RecoveryServicesVaultData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"type": "SystemAssigned"
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded",
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllJobFailures": "Enabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled"
}
}
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "RS0",
"tier": "Standard"
}
}
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"type": "SystemAssigned"
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded",
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllJobFailures": "Enabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled"
}
}
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "RS0",
"tier": "Standard"
}
}
Create or Update Vault with User Assigned Identity
Sample Request
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2023-04-01
{
"properties": {
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"location": "West US",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
}
}
import com.azure.resourcemanager.recoveryservices.models.IdentityData;
import com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType;
import com.azure.resourcemanager.recoveryservices.models.Sku;
import com.azure.resourcemanager.recoveryservices.models.SkuName;
import com.azure.resourcemanager.recoveryservices.models.UserIdentity;
import com.azure.resourcemanager.recoveryservices.models.VaultProperties;
import java.util.HashMap;
import java.util.Map;
/** Samples for Vaults CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.json
*/
/**
* Sample code: Create or Update Vault with User Assigned Identity.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultWithUserAssignedIdentity(
com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager) {
manager
.vaults()
.define("swaggerExample")
.withRegion("West US")
.withExistingResourceGroup("Default-RecoveryServices-ResourceGroup")
.withIdentity(
new IdentityData()
.withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(
mapOf(
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi",
new UserIdentity())))
.withProperties(new VaultProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED))
.withSku(new Sku().withName(SkuName.STANDARD))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
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.recoveryservices import RecoveryServicesClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservices
# USAGE
python put_vault_with_user_assigned_identity.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 = RecoveryServicesClient(
credential=DefaultAzureCredential(),
subscription_id="77777777-b0c6-47a2-b37c-d8e65a629c18",
)
response = client.vaults.begin_create_or_update(
resource_group_name="Default-RecoveryServices-ResourceGroup",
vault_name="swaggerExample",
vault={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
},
},
"location": "West US",
"properties": {"publicNetworkAccess": "Enabled"},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.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 armrecoveryservices_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/recoveryservices/armrecoveryservices"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultWithUserAssignedIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservices.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVaultsClient().BeginCreateOrUpdate(ctx, "Default-RecoveryServices-ResourceGroup", "swaggerExample", armrecoveryservices.Vault{
Location: to.Ptr("West US"),
Identity: &armrecoveryservices.IdentityData{
Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armrecoveryservices.UserIdentity{
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {},
},
},
Properties: &armrecoveryservices.VaultProperties{
PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Vault = armrecoveryservices.Vault{
// Name: to.Ptr("swaggerExample"),
// Type: to.Ptr("Microsoft.RecoveryServices/vaults"),
// Etag: to.Ptr("W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\""),
// ID: to.Ptr("/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "TestUpdatedKey": to.Ptr("TestUpdatedValue"),
// },
// Identity: &armrecoveryservices.IdentityData{
// Type: to.Ptr(armrecoveryservices.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armrecoveryservices.UserIdentity{
// "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": &armrecoveryservices.UserIdentity{
// ClientID: to.Ptr("fbe75b66-01c5-4f87-a220-233af3270436"),
// PrincipalID: to.Ptr("075a0ca6-43f6-4434-9abf-c9b1b79f9219"),
// },
// },
// },
// Properties: &armrecoveryservices.VaultProperties{
// ProvisioningState: to.Ptr("Succeeded"),
// PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
// },
// SKU: &armrecoveryservices.SKU{
// Name: to.Ptr(armrecoveryservices.SKUNameStandard),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { RecoveryServicesClient } = require("@azure/arm-recoveryservices");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates a Recovery Services vault.
*
* @summary Creates or updates a Recovery Services vault.
* x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.json
*/
async function createOrUpdateVaultWithUserAssignedIdentity() {
const subscriptionId =
process.env["RECOVERYSERVICES_SUBSCRIPTION_ID"] || "77777777-b0c6-47a2-b37c-d8e65a629c18";
const resourceGroupName =
process.env["RECOVERYSERVICES_RESOURCE_GROUP"] || "Default-RecoveryServices-ResourceGroup";
const vaultName = "swaggerExample";
const vault = {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/85bf5e8c30844f42Add2746ebb7e97b2/resourcegroups/defaultrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplemsi":
{},
},
},
location: "West US",
properties: { publicNetworkAccess: "Enabled" },
sku: { name: "Standard" },
};
const credential = new DefaultAzureCredential();
const client = new RecoveryServicesClient(credential, subscriptionId);
const result = await client.vaults.beginCreateOrUpdateAndWait(
resourceGroupName,
vaultName,
vault
);
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.RecoveryServices;
using Azure.ResourceManager.RecoveryServices.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2023-04-01/examples/PUTVault_WithUserAssignedIdentity.json
// this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "77777777-b0c6-47a2-b37c-d8e65a629c18";
string resourceGroupName = "Default-RecoveryServices-ResourceGroup";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this RecoveryServicesVaultResource
RecoveryServicesVaultCollection collection = resourceGroupResource.GetRecoveryServicesVaults();
// invoke the operation
string vaultName = "swaggerExample";
RecoveryServicesVaultData data = new RecoveryServicesVaultData(new AzureLocation("West US"))
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi")] = new UserAssignedIdentity(),
},
},
Properties = new RecoveryServicesVaultProperties()
{
PublicNetworkAccess = VaultPublicNetworkAccess.Enabled,
},
Sku = new RecoveryServicesSku(RecoveryServicesSkuName.Standard),
};
ArmOperation<RecoveryServicesVaultResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data);
RecoveryServicesVaultResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
RecoveryServicesVaultData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {
"clientId": "fbe75b66-01c5-4f87-a220-233af3270436",
"principalId": "075a0ca6-43f6-4434-9abf-c9b1b79f9219"
}
}
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Succeeded"
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "Standard"
}
}
Retry-After: 10
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
{
"location": "westus",
"name": "swaggerExample",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
},
"properties": {
"publicNetworkAccess": "Enabled",
"provisioningState": "Provisioning"
},
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"sku": {
"name": "Standard"
}
}
Definicje
Nazwa |
Opis |
AlertsState
|
|
AzureMonitorAlertSettings
|
Ustawienia alertów opartych na usłudze Azure Monitor
|
BackupStorageVersion
|
Wersja magazynu kopii zapasowej
|
ClassicAlertSettings
|
Ustawienia alertów klasycznych
|
CloudError
|
CloudError
|
CmkKekIdentity
|
Szczegóły tożsamości używanej dla klucza cmK
|
CmkKeyVaultProperties
|
Właściwości Key Vault, które hostuje klucz cmK
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
crossRegionRestore
|
Flaga umożliwiająca wyświetlenie, czy przywracanie między regionami jest włączone w magazynie, czy nie
|
CrossSubscriptionRestoreSettings
|
Ustawienia ustawień przywracania między subskrypcjami
|
crossSubscriptionRestoreState
|
|
Encryption
|
Szczegóły klucza zarządzanego przez klienta zasobu.
|
Error
|
Odpowiedź na błąd zarządzania zasobami.
|
ErrorAdditionalInfo
|
Dodatkowe informacje o błędzie zarządzania zasobami.
|
IdentityData
|
Tożsamość zasobu.
|
ImmutabilitySettings
|
Ustawienia niezmienności magazynu
|
ImmutabilityState
|
|
InfrastructureEncryptionState
|
Włączanie/wyłączanie stanu podwójnego szyfrowania
|
MonitoringSettings
|
Ustawienia monitorowania magazynu
|
MoveDetails
|
Szczegóły najnowszej operacji przenoszenia wykonanej w zasobie platformy Azure
|
MultiUserAuthorization
|
Ustawienia usługi MUA magazynu
|
PrivateEndpoint
|
Zasób sieciowy prywatnego punktu końcowego połączony z połączeniem prywatnego punktu końcowego.
|
PrivateEndpointConnection
|
Właściwości odpowiedzi połączenia prywatnego punktu końcowego.
|
PrivateEndpointConnectionStatus
|
Pobiera lub ustawia stan.
|
PrivateEndpointConnectionVaultProperties
|
Informacje, które mają być przechowywane we właściwościach magazynu jako element listy privateEndpointConnections.
|
PrivateLinkServiceConnectionState
|
Pobiera lub ustawia stan połączenia usługi private link.
|
ProvisioningState
|
Pobiera lub ustawia stan aprowizacji połączenia prywatnego punktu końcowego.
|
PublicNetworkAccess
|
właściwość umożliwiająca włączanie lub wyłączanie przychodzącego ruchu sieciowego dostawcy zasobów z klientów publicznych
|
RedundancySettings
|
Ustawienia nadmiarowości magazynu
|
ResourceIdentityType
|
Używany typ tożsamości zarządzanej. Typ "SystemAssigned, UserAssigned" zawiera zarówno niejawną utworzoną tożsamość, jak i zestaw tożsamości przypisanych przez użytkownika. Typ "Brak" spowoduje usunięcie wszystkich tożsamości.
|
ResourceMoveState
|
Stan zasobu po operacji przenoszenia
|
RestoreSettings
|
Przywracanie ustawień magazynu
|
SecureScoreLevel
|
Wskaźnik bezpieczeństwa magazynu usługi Recovery Services
|
SecuritySettings
|
Ustawienia zabezpieczeń magazynu
|
Sku
|
Określa unikatowy identyfikator systemowy dla poszczególnych zasobów platformy Azure.
|
SkuName
|
Nazwa jednostki SKU to RS0 (wersja 0 usługi Recovery Services), a warstwa jest warstwą Standardowa. Nie mają one wpływu na nadmiarowość magazynu zaplecza ani inne ustawienia magazynu. Aby zarządzać nadmiarowością magazynu, użyj polecenia backupstorageconfig
|
SoftDeleteSettings
|
Ustawienia usuwania nietrwałego magazynu
|
SoftDeleteState
|
|
standardTierStorageRedundancy
|
Ustawienie nadmiarowości magazynu magazynu
|
systemData
|
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
|
TriggerType
|
Sposób wyzwolenia uaktualnienia magazynu.
|
UpgradeDetails
|
Szczegóły uaktualniania magazynu.
|
UserIdentity
|
Tożsamość zasobu zarządzana przez użytkownika usługi.
|
Vault
|
Informacje o zasobach zwrócone przez dostawcę zasobów.
|
VaultPrivateEndpointState
|
Stan prywatnego punktu końcowego dla kopii zapasowej.
|
VaultProperties
|
Właściwości magazynu.
|
VaultSubResourceType
|
Typ podźródła magazynu AzureBackup, AzureBackup_secondary lub AzureSiteRecovery
|
VaultUpgradeState
|
Stan operacji uaktualniania magazynu.
|
AlertsState
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
AzureMonitorAlertSettings
Ustawienia alertów opartych na usłudze Azure Monitor
BackupStorageVersion
Wersja magazynu kopii zapasowej
Nazwa |
Typ |
Opis |
Unassigned
|
string
|
|
V1
|
string
|
|
V2
|
string
|
|
ClassicAlertSettings
Ustawienia alertów klasycznych
CloudError
CloudError
Nazwa |
Typ |
Opis |
error
|
Error
|
Odpowiedź na błąd zarządzania zasobami.
|
CmkKekIdentity
Szczegóły tożsamości używanej dla klucza cmK
Nazwa |
Typ |
Opis |
useSystemAssignedIdentity
|
boolean
|
Wskaż, że należy użyć tożsamości przypisanej przez system. Wzajemnie wykluczające się pole "userAssignedIdentity"
|
userAssignedIdentity
|
string
|
Tożsamość przypisana przez użytkownika do udzielenia uprawnień w przypadku, gdy używany typ tożsamości to UserAssigned
|
CmkKeyVaultProperties
Właściwości Key Vault, które hostuje klucz cmK
Nazwa |
Typ |
Opis |
keyUri
|
string
|
Identyfikator URI klucza zarządzanego przez klienta
|
createdByType
Typ tożsamości, która utworzyła zasób.
Nazwa |
Typ |
Opis |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
crossRegionRestore
Flaga umożliwiająca wyświetlenie, czy przywracanie między regionami jest włączone w magazynie, czy nie
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
CrossSubscriptionRestoreSettings
Ustawienia ustawień przywracania między subskrypcjami
crossSubscriptionRestoreState
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
PermanentlyDisabled
|
string
|
|
Encryption
Szczegóły klucza zarządzanego przez klienta zasobu.
Error
Odpowiedź na błąd zarządzania zasobami.
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
Error[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|
ErrorAdditionalInfo
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
IdentityData
Tożsamość zasobu.
Nazwa |
Typ |
Opis |
principalId
|
string
|
Identyfikator podmiotu zabezpieczeń tożsamości zasobu.
|
tenantId
|
string
|
Identyfikator dzierżawy zasobu.
|
type
|
ResourceIdentityType
|
Używany typ tożsamości zarządzanej. Typ "SystemAssigned, UserAssigned" zawiera zarówno niejawną utworzoną tożsamość, jak i zestaw tożsamości przypisanych przez użytkownika. Typ "Brak" spowoduje usunięcie wszystkich tożsamości.
|
userAssignedIdentities
|
<string,
UserIdentity>
|
Lista tożsamości przypisanych przez użytkownika skojarzonych z zasobem. Klucze słownika tożsamości przypisane przez użytkownika będą identyfikatorami zasobów usługi ARM w postaci: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}".
|
ImmutabilitySettings
Ustawienia niezmienności magazynu
ImmutabilityState
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Locked
|
string
|
|
Unlocked
|
string
|
|
InfrastructureEncryptionState
Włączanie/wyłączanie stanu podwójnego szyfrowania
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
MonitoringSettings
Ustawienia monitorowania magazynu
MoveDetails
Szczegóły najnowszej operacji przenoszenia wykonanej w zasobie platformy Azure
Nazwa |
Typ |
Opis |
completionTimeUtc
|
string
|
Godzina zakończenia operacji przenoszenia zasobu
|
operationId
|
string
|
OperationId operacji przenoszenia zasobu
|
sourceResourceId
|
string
|
Zasób źródłowy operacji przenoszenia zasobu
|
startTimeUtc
|
string
|
Godzina rozpoczęcia operacji przenoszenia zasobu
|
targetResourceId
|
string
|
Docelowy zasób operacji przenoszenia zasobu
|
MultiUserAuthorization
Ustawienia usługi MUA magazynu
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
PrivateEndpoint
Zasób sieciowy prywatnego punktu końcowego połączony z połączeniem prywatnego punktu końcowego.
Nazwa |
Typ |
Opis |
id
|
string
|
Pobiera lub ustawia identyfikator.
|
PrivateEndpointConnection
Właściwości odpowiedzi połączenia prywatnego punktu końcowego.
Nazwa |
Typ |
Opis |
groupIds
|
VaultSubResourceType[]
|
Identyfikatory grup dla prywatnego punktu końcowego
|
privateEndpoint
|
PrivateEndpoint
|
Zasób sieciowy prywatnego punktu końcowego połączony z połączeniem prywatnego punktu końcowego.
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Pobiera lub ustawia stan połączenia usługi private link.
|
provisioningState
|
ProvisioningState
|
Pobiera lub ustawia stan aprowizacji połączenia prywatnego punktu końcowego.
|
PrivateEndpointConnectionStatus
Pobiera lub ustawia stan.
Nazwa |
Typ |
Opis |
Approved
|
string
|
|
Disconnected
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
PrivateEndpointConnectionVaultProperties
Informacje, które mają być przechowywane we właściwościach magazynu jako element listy privateEndpointConnections.
Nazwa |
Typ |
Opis |
id
|
string
|
Format identyfikatorów subskrypcji/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft. [Usługa]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}.
|
location
|
string
|
Lokalizacja połączenia prywatnego punktu końcowego
|
name
|
string
|
Nazwa prywatnego połączenia punktu końcowego
|
properties
|
PrivateEndpointConnection
|
Właściwości odpowiedzi połączenia prywatnego punktu końcowego.
|
type
|
string
|
Typ, który będzie mieć format Microsoft.RecoveryServices/vaults/privateEndpointConnections
|
PrivateLinkServiceConnectionState
Pobiera lub ustawia stan połączenia usługi private link.
Nazwa |
Typ |
Opis |
actionsRequired
|
string
|
Pobiera lub ustawia wymagane akcje.
|
description
|
string
|
Pobiera lub ustawia opis.
|
status
|
PrivateEndpointConnectionStatus
|
Pobiera lub ustawia stan.
|
ProvisioningState
Pobiera lub ustawia stan aprowizacji połączenia prywatnego punktu końcowego.
Nazwa |
Typ |
Opis |
Deleting
|
string
|
|
Failed
|
string
|
|
Pending
|
string
|
|
Succeeded
|
string
|
|
PublicNetworkAccess
właściwość umożliwiająca włączanie lub wyłączanie przychodzącego ruchu sieciowego dostawcy zasobów z klientów publicznych
Nazwa |
Typ |
Opis |
Disabled
|
string
|
|
Enabled
|
string
|
|
RedundancySettings
Ustawienia nadmiarowości magazynu
Nazwa |
Typ |
Opis |
crossRegionRestore
|
crossRegionRestore
|
Flaga umożliwiająca wyświetlenie, czy przywracanie między regionami jest włączone w magazynie, czy nie
|
standardTierStorageRedundancy
|
standardTierStorageRedundancy
|
Ustawienie nadmiarowości magazynu magazynu
|
ResourceIdentityType
Używany typ tożsamości zarządzanej. Typ "SystemAssigned, UserAssigned" zawiera zarówno niejawną utworzoną tożsamość, jak i zestaw tożsamości przypisanych przez użytkownika. Typ "Brak" spowoduje usunięcie wszystkich tożsamości.
Nazwa |
Typ |
Opis |
None
|
string
|
|
SystemAssigned
|
string
|
|
SystemAssigned, UserAssigned
|
string
|
|
UserAssigned
|
string
|
|
ResourceMoveState
Stan zasobu po operacji przenoszenia
Nazwa |
Typ |
Opis |
CommitFailed
|
string
|
|
CommitTimedout
|
string
|
|
CriticalFailure
|
string
|
|
Failure
|
string
|
|
InProgress
|
string
|
|
MoveSucceeded
|
string
|
|
PartialSuccess
|
string
|
|
PrepareFailed
|
string
|
|
PrepareTimedout
|
string
|
|
Unknown
|
string
|
|
RestoreSettings
Przywracanie ustawień magazynu
SecureScoreLevel
Wskaźnik bezpieczeństwa magazynu usługi Recovery Services
Nazwa |
Typ |
Opis |
Adequate
|
string
|
|
Maximum
|
string
|
|
Minimum
|
string
|
|
None
|
string
|
|
SecuritySettings
Ustawienia zabezpieczeń magazynu
Sku
Określa unikatowy identyfikator systemowy dla poszczególnych zasobów platformy Azure.
Nazwa |
Typ |
Opis |
capacity
|
string
|
Pojemność jednostki SKU
|
family
|
string
|
Rodzina jednostek SKU
|
name
|
SkuName
|
Nazwa jednostki SKU to RS0 (wersja 0 usługi Recovery Services), a warstwa jest warstwą Standardowa. Nie mają one wpływu na nadmiarowość magazynu zaplecza ani inne ustawienia magazynu. Aby zarządzać nadmiarowością magazynu, użyj polecenia backupstorageconfig
|
size
|
string
|
Rozmiar jednostki SKU
|
tier
|
string
|
Warstwa jednostki SKU.
|
SkuName
Nazwa jednostki SKU to RS0 (wersja 0 usługi Recovery Services), a warstwa jest warstwą Standardowa. Nie mają one wpływu na nadmiarowość magazynu zaplecza ani inne ustawienia magazynu. Aby zarządzać nadmiarowością magazynu, użyj polecenia backupstorageconfig
Nazwa |
Typ |
Opis |
RS0
|
string
|
|
Standard
|
string
|
|
SoftDeleteSettings
Ustawienia usuwania nietrwałego magazynu
Nazwa |
Typ |
Opis |
softDeleteRetentionPeriodInDays
|
integer
|
Okres przechowywania usuwania nietrwałego w dniach
|
softDeleteState
|
SoftDeleteState
|
|
SoftDeleteState
Nazwa |
Typ |
Opis |
AlwaysON
|
string
|
|
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
standardTierStorageRedundancy
Ustawienie nadmiarowości magazynu magazynu
Nazwa |
Typ |
Opis |
GeoRedundant
|
string
|
|
LocallyRedundant
|
string
|
|
ZoneRedundant
|
string
|
|
systemData
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
Nazwa |
Typ |
Opis |
createdAt
|
string
|
Sygnatura czasowa tworzenia zasobu (UTC).
|
createdBy
|
string
|
Tożsamość, która utworzyła zasób.
|
createdByType
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
lastModifiedAt
|
string
|
Typ tożsamości, która ostatnio zmodyfikowała zasób.
|
lastModifiedBy
|
string
|
Tożsamość, która ostatnio zmodyfikowała zasób.
|
lastModifiedByType
|
createdByType
|
Typ tożsamości, która ostatnio zmodyfikowała zasób.
|
TriggerType
Sposób wyzwolenia uaktualnienia magazynu.
Nazwa |
Typ |
Opis |
ForcedUpgrade
|
string
|
|
UserTriggered
|
string
|
|
UpgradeDetails
Szczegóły uaktualniania magazynu.
Nazwa |
Typ |
Opis |
endTimeUtc
|
string
|
Czas UTC, o którym zakończyła się operacja uaktualniania.
|
lastUpdatedTimeUtc
|
string
|
Godzina UTC, w której stan operacji uaktualniania został ostatnio zaktualizowany.
|
message
|
string
|
Komunikat do użytkownika zawierającego informacje o operacji uaktualniania.
|
operationId
|
string
|
Identyfikator operacji uaktualniania magazynu.
|
previousResourceId
|
string
|
Identyfikator zasobu magazynu przed uaktualnieniem.
|
startTimeUtc
|
string
|
Godzina UTC, o której rozpoczęto operację uaktualniania.
|
status
|
VaultUpgradeState
|
Stan operacji uaktualniania magazynu.
|
triggerType
|
TriggerType
|
Sposób wyzwolenia uaktualnienia magazynu.
|
upgradedResourceId
|
string
|
Identyfikator zasobu uaktualnionego magazynu.
|
UserIdentity
Tożsamość zasobu zarządzana przez użytkownika usługi.
Nazwa |
Typ |
Opis |
clientId
|
string
|
Identyfikator klienta tożsamości przypisanej przez użytkownika.
|
principalId
|
string
|
Główny identyfikator tożsamości przypisanej przez użytkownika.
|
Vault
Informacje o zasobach zwrócone przez dostawcę zasobów.
Nazwa |
Typ |
Opis |
etag
|
string
|
Opcjonalny element ETag.
|
id
|
string
|
Identyfikator zasobu reprezentuje pełną ścieżkę do zasobu.
|
identity
|
IdentityData
|
Tożsamość zasobu.
|
location
|
string
|
Lokalizacja zasobu.
|
name
|
string
|
Nazwa zasobu skojarzona z zasobem.
|
properties
|
VaultProperties
|
Właściwości magazynu.
|
sku
|
Sku
|
Określa unikatowy identyfikator systemowy dla poszczególnych zasobów platformy Azure.
|
systemData
|
systemData
|
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
|
tags
|
object
|
Tagi zasobów.
|
type
|
string
|
Typ zasobu reprezentuje pełną ścieżkę formularza Namespace/ResourceType/ResourceType/...
|
VaultPrivateEndpointState
Stan prywatnego punktu końcowego dla kopii zapasowej.
Nazwa |
Typ |
Opis |
Enabled
|
string
|
|
None
|
string
|
|
VaultProperties
Właściwości magazynu.
VaultSubResourceType
Typ podźródła magazynu AzureBackup, AzureBackup_secondary lub AzureSiteRecovery
Nazwa |
Typ |
Opis |
AzureBackup
|
string
|
|
AzureBackup_secondary
|
string
|
|
AzureSiteRecovery
|
string
|
|
VaultUpgradeState
Stan operacji uaktualniania magazynu.
Nazwa |
Typ |
Opis |
Failed
|
string
|
|
InProgress
|
string
|
|
Unknown
|
string
|
|
Upgraded
|
string
|
|