Creates or updates a Recovery Services vault.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}?api-version=2024-04-01
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
vaultName
|
path |
True
|
string
|
The name of the recovery services vault.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Name |
Required |
Type |
Description |
x-ms-authorization-auxiliary
|
|
string
|
|
Request Body
Name |
Required |
Type |
Description |
location
|
True
|
string
|
Resource location.
|
etag
|
|
string
|
Optional ETag.
|
identity
|
|
IdentityData
|
Identity for the resource.
|
properties
|
|
VaultProperties
|
Properties of the vault.
|
sku
|
|
Sku
|
Identifies the unique system identifier for each Azure resource.
|
tags
|
|
object
|
Resource tags.
|
Responses
Name |
Type |
Description |
200 OK
|
Vault
|
OK
|
201 Created
|
Vault
|
Created
|
Other Status Codes
|
CloudError
|
Error response describing why the operation failed.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account.
|
Examples
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=2024-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/2024-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 typing import Any, IO, Union
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/2024-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-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),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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/2024-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
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"
}
}
Sample request
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2024-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"
},
"resourceGuardOperationRequests": [
"/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default"
]
},
"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.Arrays;
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/2024-04-01/examples/
* PUTVault_ResourceGuardEnabled.json
*/
/**
* Sample code: Create or Update Vault performing critical operation With MUA.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultPerformingCriticalOperationWithMUA(
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)
.withResourceGuardOperationRequests(Arrays.asList(
"/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default")))
.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 typing import Any, IO, Union
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_resource_guard_enabled.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",
"resourceGuardOperationRequests": [
"/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default"
],
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_ResourceGuardEnabled.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_ResourceGuardEnabled.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultPerformingCriticalOperationWithMua() {
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),
ResourceGuardOperationRequests: []*string{
to.Ptr("/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default")},
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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/2024-04-01/examples/PUTVault_ResourceGuardEnabled.json
*/
async function createOrUpdateVaultPerformingCriticalOperationWithMua() {
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",
resourceGuardOperationRequests: [
"/subscriptions/38304e13-357e-405e-9e9a-220351dcce8c/resourcegroups/ankurResourceGuard1/providers/Microsoft.DataProtection/resourceGuards/ResourceGuard38-1/modifyEncryptionSettings/default",
],
},
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
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 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=2024-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/2024-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 typing import Any, IO, Union
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/2024-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-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),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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/2024-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
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=2024-04-01
{
"properties": {
"publicNetworkAccess": "Enabled",
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllJobFailures": "Enabled",
"alertsForAllReplicationIssues": "Enabled",
"alertsForAllFailoverIssues": "Disabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled"
}
}
},
"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/2024-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)
.withAlertsForAllReplicationIssues(AlertsState.ENABLED)
.withAlertsForAllFailoverIssues(AlertsState.DISABLED))
.withClassicAlertSettings(
new ClassicAlertSettings().withAlertsForCriticalOperations(AlertsState.DISABLED)
.withEmailNotificationsForSiteRecovery(AlertsState.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 typing import Any, IO, Union
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": {
"alertsForAllFailoverIssues": "Disabled",
"alertsForAllJobFailures": "Enabled",
"alertsForAllReplicationIssues": "Enabled",
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled",
},
},
"publicNetworkAccess": "Enabled",
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-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{
AlertsForAllFailoverIssues: to.Ptr(armrecoveryservices.AlertsStateDisabled),
AlertsForAllJobFailures: to.Ptr(armrecoveryservices.AlertsStateEnabled),
AlertsForAllReplicationIssues: to.Ptr(armrecoveryservices.AlertsStateEnabled),
},
ClassicAlertSettings: &armrecoveryservices.ClassicAlertSettings{
AlertsForCriticalOperations: to.Ptr(armrecoveryservices.AlertsStateDisabled),
EmailNotificationsForSiteRecovery: to.Ptr(armrecoveryservices.AlertsStateEnabled),
},
},
PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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{
// AlertsForAllFailoverIssues: to.Ptr(armrecoveryservices.AlertsStateDisabled),
// AlertsForAllJobFailures: to.Ptr(armrecoveryservices.AlertsStateEnabled),
// AlertsForAllReplicationIssues: to.Ptr(armrecoveryservices.AlertsStateEnabled),
// },
// ClassicAlertSettings: &armrecoveryservices.ClassicAlertSettings{
// AlertsForCriticalOperations: to.Ptr(armrecoveryservices.AlertsStateDisabled),
// EmailNotificationsForSiteRecovery: to.Ptr(armrecoveryservices.AlertsStateEnabled),
// },
// },
// 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/2024-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: {
alertsForAllFailoverIssues: "Disabled",
alertsForAllJobFailures: "Enabled",
alertsForAllReplicationIssues: "Enabled",
},
classicAlertSettings: {
alertsForCriticalOperations: "Disabled",
emailNotificationsForSiteRecovery: "Enabled",
},
},
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
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",
"alertsForAllReplicationIssues": "Enabled",
"alertsForAllFailoverIssues": "Disabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled"
}
}
},
"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",
"alertsForAllReplicationIssues": "Enabled",
"alertsForAllFailoverIssues": "Disabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled"
}
}
},
"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 Redundancy 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=2024-04-01
{
"properties": {
"publicNetworkAccess": "Enabled",
"redundancySettings": {
"standardTierStorageRedundancy": "GeoRedundant",
"crossRegionRestore": "Enabled"
}
},
"sku": {
"name": "Standard"
},
"location": "West US",
"identity": {
"type": "SystemAssigned"
}
}
import com.azure.resourcemanager.recoveryservices.models.CrossRegionRestore;
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.StandardTierStorageRedundancy;
import com.azure.resourcemanager.recoveryservices.models.VaultProperties;
import com.azure.resourcemanager.recoveryservices.models.VaultPropertiesRedundancySettings;
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/2024-04-01/examples/
* PUTVault_WithRedundancySettings.json
*/
/**
* Sample code: Create or Update Vault With Redundancy Setting.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultWithRedundancySetting(
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)
.withRedundancySettings(new VaultPropertiesRedundancySettings()
.withStandardTierStorageRedundancy(StandardTierStorageRedundancy.GEO_REDUNDANT)
.withCrossRegionRestore(CrossRegionRestore.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 typing import Any, IO, Union
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_redundancy_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": {
"publicNetworkAccess": "Enabled",
"redundancySettings": {
"crossRegionRestore": "Enabled",
"standardTierStorageRedundancy": "GeoRedundant",
},
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithRedundancySettings.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PUTVault_WithRedundancySettings.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultWithRedundancySetting() {
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),
RedundancySettings: &armrecoveryservices.VaultPropertiesRedundancySettings{
CrossRegionRestore: to.Ptr(armrecoveryservices.CrossRegionRestoreEnabled),
StandardTierStorageRedundancy: to.Ptr(armrecoveryservices.StandardTierStorageRedundancyGeoRedundant),
},
},
SKU: &armrecoveryservices.SKU{
Name: to.Ptr(armrecoveryservices.SKUNameStandard),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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),
// RedundancySettings: &armrecoveryservices.VaultPropertiesRedundancySettings{
// CrossRegionRestore: to.Ptr(armrecoveryservices.CrossRegionRestoreEnabled),
// StandardTierStorageRedundancy: to.Ptr(armrecoveryservices.StandardTierStorageRedundancyGeoRedundant),
// },
// },
// 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/2024-04-01/examples/PUTVault_WithRedundancySettings.json
*/
async function createOrUpdateVaultWithRedundancySetting() {
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",
redundancySettings: {
crossRegionRestore: "Enabled",
standardTierStorageRedundancy: "GeoRedundant",
},
},
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
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",
"redundancySettings": {
"standardTierStorageRedundancy": "GeoRedundant",
"crossRegionRestore": "Enabled"
}
},
"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",
"redundancySettings": {
"standardTierStorageRedundancy": "GeoRedundant",
"crossRegionRestore": "Enabled"
}
},
"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=2024-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/2024-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 typing import Any, IO, Union
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/2024-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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2024-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),
},
}, &armrecoveryservices.VaultsClientBeginCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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/2024-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
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"
}
}
Definitions
AlertsState
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
AzureMonitorAlertSettings
Settings for Azure Monitor based alerts
BackupStorageVersion
Backup storage version
Name |
Type |
Description |
Unassigned
|
string
|
|
V1
|
string
|
|
V2
|
string
|
|
BCDRSecurityLevel
Security levels of Recovery Services Vault for business continuity and disaster recovery
Name |
Type |
Description |
Excellent
|
string
|
|
Fair
|
string
|
|
Good
|
string
|
|
Poor
|
string
|
|
ClassicAlertSettings
Settings for classic alerts
CloudError
CloudError
Name |
Type |
Description |
error
|
Error
|
The resource management error response.
|
CmkKekIdentity
The details of the identity used for CMK
Name |
Type |
Description |
useSystemAssignedIdentity
|
boolean
|
Indicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field
|
userAssignedIdentity
|
string
|
The user assigned identity to be used to grant permissions in case the type of identity used is UserAssigned
|
CmkKeyVaultProperties
The properties of the Key Vault which hosts CMK
Name |
Type |
Description |
keyUri
|
string
|
The key uri of the Customer Managed Key
|
createdByType
The type of identity that created the resource.
Name |
Type |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
crossRegionRestore
Flag to show if Cross Region Restore is enabled on the Vault or not
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
CrossSubscriptionRestoreSettings
Settings for Cross Subscription Restore Settings
crossSubscriptionRestoreState
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
PermanentlyDisabled
|
string
|
|
Encryption
Customer Managed Key details of the resource.
EnhancedSecurityState
Name |
Type |
Description |
AlwaysON
|
string
|
|
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
Error
The resource management error response.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
Error[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
IdentityData
Identity for the resource.
Name |
Type |
Description |
principalId
|
string
|
The principal ID of resource identity.
|
tenantId
|
string
|
The tenant ID of resource.
|
type
|
ResourceIdentityType
|
The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities.
|
userAssignedIdentities
|
<string,
UserIdentity>
|
The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
ImmutabilitySettings
Immutability Settings of vault
ImmutabilityState
Name |
Type |
Description |
Disabled
|
string
|
|
Locked
|
string
|
|
Unlocked
|
string
|
|
InfrastructureEncryptionState
Enabling/Disabling the Double Encryption state
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
MonitoringSettings
Monitoring Settings of the vault
MoveDetails
The details of the latest move operation performed on the Azure Resource
Name |
Type |
Description |
completionTimeUtc
|
string
|
End Time of the Resource Move Operation
|
operationId
|
string
|
OperationId of the Resource Move Operation
|
sourceResourceId
|
string
|
Source Resource of the Resource Move Operation
|
startTimeUtc
|
string
|
Start Time of the Resource Move Operation
|
targetResourceId
|
string
|
Target Resource of the Resource Move Operation
|
MultiUserAuthorization
MUA Settings of vault
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
PrivateEndpoint
The Private Endpoint network resource that is linked to the Private Endpoint connection.
Name |
Type |
Description |
id
|
string
|
Gets or sets id.
|
PrivateEndpointConnection
Private Endpoint Connection Response Properties.
Name |
Type |
Description |
groupIds
|
VaultSubResourceType[]
|
Group Ids for the Private Endpoint
|
privateEndpoint
|
PrivateEndpoint
|
The Private Endpoint network resource that is linked to the Private Endpoint connection.
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Gets or sets private link service connection state.
|
provisioningState
|
ProvisioningState
|
Gets or sets provisioning state of the private endpoint connection.
|
PrivateEndpointConnectionStatus
Gets or sets the status.
Name |
Type |
Description |
Approved
|
string
|
|
Disconnected
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
PrivateEndpointConnectionVaultProperties
Information to be stored in Vault properties as an element of privateEndpointConnections List.
Name |
Type |
Description |
id
|
string
|
Format of id subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}.
|
location
|
string
|
The location of the private Endpoint connection
|
name
|
string
|
The name of the private Endpoint Connection
|
properties
|
PrivateEndpointConnection
|
Private Endpoint Connection Response Properties.
|
type
|
string
|
The type, which will be of the format, Microsoft.RecoveryServices/vaults/privateEndpointConnections
|
PrivateLinkServiceConnectionState
Gets or sets private link service connection state.
Name |
Type |
Description |
actionsRequired
|
string
|
Gets or sets actions required.
|
description
|
string
|
Gets or sets description.
|
status
|
PrivateEndpointConnectionStatus
|
Gets or sets the status.
|
ProvisioningState
Gets or sets provisioning state of the private endpoint connection.
Name |
Type |
Description |
Deleting
|
string
|
|
Failed
|
string
|
|
Pending
|
string
|
|
Succeeded
|
string
|
|
PublicNetworkAccess
property to enable or disable resource provider inbound network traffic from public clients
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
RedundancySettings
The redundancy Settings of a Vault
ResourceIdentityType
The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities.
Name |
Type |
Description |
None
|
string
|
|
SystemAssigned
|
string
|
|
SystemAssigned, UserAssigned
|
string
|
|
UserAssigned
|
string
|
|
ResourceMoveState
The State of the Resource after the move operation
Name |
Type |
Description |
CommitFailed
|
string
|
|
CommitTimedout
|
string
|
|
CriticalFailure
|
string
|
|
Failure
|
string
|
|
InProgress
|
string
|
|
MoveSucceeded
|
string
|
|
PartialSuccess
|
string
|
|
PrepareFailed
|
string
|
|
PrepareTimedout
|
string
|
|
Unknown
|
string
|
|
RestoreSettings
Restore Settings of the vault
SecureScoreLevel
Secure Score of Recovery Services Vault
Name |
Type |
Description |
Adequate
|
string
|
|
Maximum
|
string
|
|
Minimum
|
string
|
|
None
|
string
|
|
SecuritySettings
Security Settings of the vault
Sku
Identifies the unique system identifier for each Azure resource.
Name |
Type |
Description |
capacity
|
string
|
The sku capacity
|
family
|
string
|
The sku family
|
name
|
SkuName
|
Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on backend storage redundancy or any other vault settings. To manage storage redundancy, use the backupstorageconfig
|
size
|
string
|
The sku size
|
tier
|
string
|
The Sku tier.
|
SkuName
Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on backend storage redundancy or any other vault settings. To manage storage redundancy, use the backupstorageconfig
Name |
Type |
Description |
RS0
|
string
|
|
Standard
|
string
|
|
SoftDeleteSettings
Soft delete Settings of vault
SoftDeleteState
Name |
Type |
Description |
AlwaysON
|
string
|
|
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
standardTierStorageRedundancy
The storage redundancy setting of a vault
Name |
Type |
Description |
GeoRedundant
|
string
|
|
Invalid
|
string
|
|
LocallyRedundant
|
string
|
|
ZoneRedundant
|
string
|
|
systemData
Metadata pertaining to creation and last modification of the resource.
Name |
Type |
Description |
createdAt
|
string
|
The timestamp of resource creation (UTC).
|
createdBy
|
string
|
The identity that created the resource.
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
lastModifiedAt
|
string
|
The type of identity that last modified the resource.
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
TriggerType
The way the vault upgrade was triggered.
Name |
Type |
Description |
ForcedUpgrade
|
string
|
|
UserTriggered
|
string
|
|
UpgradeDetails
Details for upgrading vault.
Name |
Type |
Description |
endTimeUtc
|
string
|
UTC time at which the upgrade operation has ended.
|
lastUpdatedTimeUtc
|
string
|
UTC time at which the upgrade operation status was last updated.
|
message
|
string
|
Message to the user containing information about the upgrade operation.
|
operationId
|
string
|
ID of the vault upgrade operation.
|
previousResourceId
|
string
|
Resource ID of the vault before the upgrade.
|
startTimeUtc
|
string
|
UTC time at which the upgrade operation has started.
|
status
|
VaultUpgradeState
|
Status of the vault upgrade operation.
|
triggerType
|
TriggerType
|
The way the vault upgrade was triggered.
|
upgradedResourceId
|
string
|
Resource ID of the upgraded vault.
|
UserIdentity
A resource identity that is managed by the user of the service.
Name |
Type |
Description |
clientId
|
string
|
The client ID of the user-assigned identity.
|
principalId
|
string
|
The principal ID of the user-assigned identity.
|
Vault
Resource information, as returned by the resource provider.
Name |
Type |
Description |
etag
|
string
|
Optional ETag.
|
id
|
string
|
Resource Id represents the complete path to the resource.
|
identity
|
IdentityData
|
Identity for the resource.
|
location
|
string
|
Resource location.
|
name
|
string
|
Resource name associated with the resource.
|
properties
|
VaultProperties
|
Properties of the vault.
|
sku
|
Sku
|
Identifies the unique system identifier for each Azure resource.
|
systemData
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
tags
|
object
|
Resource tags.
|
type
|
string
|
Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
|
VaultPrivateEndpointState
Private endpoint state for backup.
Name |
Type |
Description |
Enabled
|
string
|
|
None
|
string
|
|
VaultProperties
Properties of the vault.
Name |
Type |
Description |
backupStorageVersion
|
BackupStorageVersion
|
Backup storage version
|
bcdrSecurityLevel
|
BCDRSecurityLevel
|
Security levels of Recovery Services Vault for business continuity and disaster recovery
|
encryption
|
Encryption
|
Customer Managed Key details of the resource.
|
monitoringSettings
|
MonitoringSettings
|
Monitoring Settings of the vault
|
moveDetails
|
MoveDetails
|
The details of the latest move operation performed on the Azure Resource
|
moveState
|
ResourceMoveState
|
The State of the Resource after the move operation
|
privateEndpointConnections
|
PrivateEndpointConnectionVaultProperties[]
|
List of private endpoint connection.
|
privateEndpointStateForBackup
|
VaultPrivateEndpointState
|
Private endpoint state for backup.
|
privateEndpointStateForSiteRecovery
|
VaultPrivateEndpointState
|
Private endpoint state for site recovery.
|
provisioningState
|
string
|
Provisioning State.
|
publicNetworkAccess
|
PublicNetworkAccess
|
property to enable or disable resource provider inbound network traffic from public clients
|
redundancySettings
|
RedundancySettings
|
The redundancy Settings of a Vault
|
resourceGuardOperationRequests
|
string[]
|
ResourceGuardOperationRequests on which LAC check will be performed
|
restoreSettings
|
RestoreSettings
|
Restore Settings of the vault
|
secureScore
|
SecureScoreLevel
|
Secure Score of Recovery Services Vault
|
securitySettings
|
SecuritySettings
|
Security Settings of the vault
|
upgradeDetails
|
UpgradeDetails
|
Details for upgrading vault.
|
VaultSubResourceType
Subresource type for vault AzureBackup, AzureBackup_secondary or AzureSiteRecovery
Name |
Type |
Description |
AzureBackup
|
string
|
|
AzureBackup_secondary
|
string
|
|
AzureSiteRecovery
|
string
|
|
VaultUpgradeState
Status of the vault upgrade operation.
Name |
Type |
Description |
Failed
|
string
|
|
InProgress
|
string
|
|
Unknown
|
string
|
|
Upgraded
|
string
|
|