Crea o aggiorna un insieme di credenziali di Servizi di ripristino.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}?api-version=2025-02-01
Parametri dell'URI
Nome |
In |
Necessario |
Tipo |
Descrizione |
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nome del gruppo di risorse. Il nome è insensibile alle maiuscole e minuscole.
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
ID della sottoscrizione di destinazione.
|
vaultName
|
path |
True
|
string
|
Il nome del Vault
|
api-version
|
query |
True
|
string
minLength: 1
|
Versione dell'API da usare per questa operazione.
|
Nome |
Necessario |
Tipo |
Descrizione |
x-ms-authorization-auxiliary
|
|
string
|
|
Corpo della richiesta
Nome |
Necessario |
Tipo |
Descrizione |
location
|
True
|
string
|
Posizione geografica in cui risiede la risorsa
|
etag
|
|
string
|
etag per la risorsa.
|
identity
|
|
IdentityData
|
Identità per la risorsa.
|
properties
|
|
VaultProperties
|
Proprietà dell'insieme di credenziali.
|
sku
|
|
Sku
|
Identifica l'identificatore di sistema univoco per ogni risorsa di Azure.
|
tags
|
|
object
|
Tag di risorsa.
|
Risposte
Nome |
Tipo |
Descrizione |
200 OK
|
Vault
|
Operazione di aggiornamento della risorsa 'Vault' riuscita
|
201 Created
|
Vault
|
Operazione di creazione della risorsa 'Vault' riuscita
Intestazioni
- Location: string
- Retry-After: integer
|
Other Status Codes
|
CloudError
|
Risposta di errore imprevista.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory.
Tipo:
oauth2
Flow:
implicit
URL di autorizzazione:
https://login.microsoftonline.com/common/oauth2/authorize
Ambiti
Nome |
Descrizione |
user_impersonation
|
rappresentare l'account utente
|
Esempio
Create or Update Recovery Services vault
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "West US",
"properties": {
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
}
}
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/2025-02-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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"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"
}
}
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/2025-02-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 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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"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"
}
}
},
"location": "westus",
"properties": {
"encryption": {
"infrastructureEncryption": "Enabled",
"kekIdentity": {
"useSystemAssignedIdentity": false,
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
}
},
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
Retry-After: 10
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
},
"location": "westus",
"properties": {
"encryption": {
"infrastructureEncryption": "Enabled",
"kekIdentity": {
"useSystemAssignedIdentity": false,
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
}
},
"provisioningState": "Provisioning",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Create or Update Vault with CustomerManagedKeys
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"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"
}
}
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/2025-02-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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"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"
}
}
},
"location": "westus",
"properties": {
"encryption": {
"infrastructureEncryption": "Enabled",
"kekIdentity": {
"useSystemAssignedIdentity": false,
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
}
},
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
Retry-After: 10
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
},
"location": "westus",
"properties": {
"encryption": {
"infrastructureEncryption": "Enabled",
"kekIdentity": {
"useSystemAssignedIdentity": false,
"userAssignedIdentity": "/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"
},
"keyVaultProperties": {
"keyUri": "https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3"
}
},
"provisioningState": "Provisioning",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Create or Update Vault With Monitoring Setting
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"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"
}
}
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/2025-02-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 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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllFailoverIssues": "Disabled",
"alertsForAllJobFailures": "Enabled",
"alertsForAllReplicationIssues": "Enabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled"
}
},
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"monitoringSettings": {
"azureMonitorAlertSettings": {
"alertsForAllFailoverIssues": "Disabled",
"alertsForAllJobFailures": "Enabled",
"alertsForAllReplicationIssues": "Enabled"
},
"classicAlertSettings": {
"alertsForCriticalOperations": "Disabled",
"emailNotificationsForSiteRecovery": "Enabled"
}
},
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Create or Update Vault With Redundancy Setting
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "West US",
"properties": {
"publicNetworkAccess": "Enabled",
"redundancySettings": {
"crossRegionRestore": "Enabled",
"standardTierStorageRedundancy": "GeoRedundant"
}
},
"sku": {
"name": "Standard"
}
}
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/2025-02-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 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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled",
"redundancySettings": {
"crossRegionRestore": "Enabled",
"standardTierStorageRedundancy": "GeoRedundant"
}
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "3137d6c7-5d6c-411c-b934-7a2a729ee247",
"tenantId": "d676e86e-2206-4a7c-999c-ece52c144b5b"
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled",
"redundancySettings": {
"crossRegionRestore": "Enabled",
"standardTierStorageRedundancy": "GeoRedundant"
}
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Create or Update Vault with Source scan configuration
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "West US",
"properties": {
"publicNetworkAccess": "Enabled",
"securitySettings": {
"sourceScanConfiguration": {
"sourceScanIdentity": {
"operationIdentityType": "SystemAssigned"
},
"state": "Enabled"
}
}
},
"sku": {
"name": "Standard"
}
}
import com.azure.resourcemanager.recoveryservices.models.AssociatedIdentity;
import com.azure.resourcemanager.recoveryservices.models.IdentityData;
import com.azure.resourcemanager.recoveryservices.models.IdentityType;
import com.azure.resourcemanager.recoveryservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.recoveryservices.models.ResourceIdentityType;
import com.azure.resourcemanager.recoveryservices.models.SecuritySettings;
import com.azure.resourcemanager.recoveryservices.models.Sku;
import com.azure.resourcemanager.recoveryservices.models.SkuName;
import com.azure.resourcemanager.recoveryservices.models.SourceScanConfiguration;
import com.azure.resourcemanager.recoveryservices.models.State;
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/2025-02-01/examples/
* PUTVault_WithSourceScanConfiguration.json
*/
/**
* Sample code: Create or Update Vault with Source scan configuration.
*
* @param manager Entry point to RecoveryServicesManager.
*/
public static void createOrUpdateVaultWithSourceScanConfiguration(
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)
.withSecuritySettings(new SecuritySettings().withSourceScanConfiguration(
new SourceScanConfiguration().withState(State.ENABLED).withSourceScanIdentity(
new AssociatedIdentity().withOperationIdentityType(IdentityType.SYSTEM_ASSIGNED)))))
.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_source_scan_configuration.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",
"securitySettings": {
"sourceScanConfiguration": {
"sourceScanIdentity": {"operationIdentityType": "SystemAssigned"},
"state": "Enabled",
}
},
},
"sku": {"name": "Standard"},
},
).result()
print(response)
# x-ms-original-file: specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PUTVault_WithSourceScanConfiguration.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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PUTVault_WithSourceScanConfiguration.json
func ExampleVaultsClient_BeginCreateOrUpdate_createOrUpdateVaultWithSourceScanConfiguration() {
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),
SecuritySettings: &armrecoveryservices.SecuritySettings{
SourceScanConfiguration: &armrecoveryservices.SourceScanConfiguration{
SourceScanIdentity: &armrecoveryservices.AssociatedIdentity{
OperationIdentityType: to.Ptr(armrecoveryservices.IdentityTypeSystemAssigned),
},
State: to.Ptr(armrecoveryservices.StateEnabled),
},
},
},
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'2025-02-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("1be097b0-eb5e-4927-bac2-b24ee8716f64"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Properties: &armrecoveryservices.VaultProperties{
// ProvisioningState: to.Ptr("Succeeded"),
// PublicNetworkAccess: to.Ptr(armrecoveryservices.PublicNetworkAccessEnabled),
// SecuritySettings: &armrecoveryservices.SecuritySettings{
// SourceScanConfiguration: &armrecoveryservices.SourceScanConfiguration{
// SourceScanIdentity: &armrecoveryservices.AssociatedIdentity{
// OperationIdentityType: to.Ptr(armrecoveryservices.IdentityTypeSystemAssigned),
// },
// State: to.Ptr(armrecoveryservices.StateEnabled),
// },
// },
// },
// 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");
require("dotenv/config");
/**
* 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/2025-02-01/examples/PUTVault_WithSourceScanConfiguration.json
*/
async function createOrUpdateVaultWithSourceScanConfiguration() {
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",
securitySettings: {
sourceScanConfiguration: {
sourceScanIdentity: { operationIdentityType: "SystemAssigned" },
state: "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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2025-02-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "1be097b0-eb5e-4927-bac2-b24ee8716f64",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled",
"securitySettings": {
"sourceScanConfiguration": {
"sourceScanIdentity": {
"operationIdentityType": "SystemAssigned"
},
"state": "Enabled"
}
}
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
Retry-After: 10
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "SystemAssigned",
"principalId": "1be097b0-eb5e-4927-bac2-b24ee8716f64",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"location": "westus",
"properties": {
"provisioningState": "Provisioning",
"publicNetworkAccess": "Enabled",
"securitySettings": {
"sourceScanConfiguration": {
"sourceScanIdentity": {
"operationIdentityType": "SystemAssigned"
},
"state": "Enabled"
}
}
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Create or Update Vault with User Assigned Identity
Esempio di richiesta
PUT https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample?api-version=2025-02-01
{
"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"
}
}
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/2025-02-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/2025-02-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/82e9c6f9fbfa2d6d47d5e2a6a11c0ad2eb345c43/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/stable/2025-02-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");
require("dotenv/config");
/**
* 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/2025-02-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
Risposta di esempio
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"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"
}
}
},
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Azure-AsyncOperation: /subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample/operationStatus/YWUzNDFkMzQtZmM5OS00MmUyLWEzNDMtZGJkMDIxZjlmZjgzOzdmYzBiMzhmLTc2NmItNDM5NS05OWQ1LTVmOGEzNzg4MWQzNA==?api-version=2015-03-15
Retry-After: 10
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/vaults",
"etag": "W/\"datetime'2017-12-15T12%3A36%3A51.68Z'\"",
"id": "/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/Default-RecoveryServices-ResourceGroup/providers/Microsoft.RecoveryServices/vaults/swaggerExample",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi": {}
}
},
"location": "westus",
"properties": {
"provisioningState": "Provisioning",
"publicNetworkAccess": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"TestUpdatedKey": "TestUpdatedValue"
}
}
Definizioni
AlertsState
Enumerazione
Valore |
Descrizione |
Enabled
|
|
Disabled
|
|
AssociatedIdentity
Object
Dettagli identità da usare per un'operazione
Nome |
Tipo |
Descrizione |
operationIdentityType
|
IdentityType
|
Tipo di identità che deve essere usato per un'operazione.
|
userAssignedIdentity
|
string
|
Identità assegnata dall'utente da usare per un'operazione se operationIdentityType è UserAssigned.
|
AzureMonitorAlertSettings
Object
Impostazioni per gli avvisi basati su Monitoraggio di Azure
BackupStorageVersion
Enumerazione
Versione dell'archiviazione di backup
Valore |
Descrizione |
V1
|
|
V2
|
|
Unassigned
|
|
BCDRSecurityLevel
Enumerazione
Livelli di sicurezza dell'insieme di credenziali di Servizi di ripristino per la continuità aziendale e il ripristino di emergenza
Valore |
Descrizione |
Poor
|
|
Fair
|
|
Good
|
|
Excellent
|
|
ClassicAlertSettings
Object
Impostazioni per gli avvisi classici
CloudError
Object
Risposta di errore da Backup di Azure.
Nome |
Tipo |
Descrizione |
error
|
Error
|
Risposta di errore di gestione delle risorse.
|
CmkKekIdentity
Object
Dettagli dell'identità usata per la chiave gestita dal cliente
Nome |
Tipo |
Descrizione |
useSystemAssignedIdentity
|
boolean
|
Indicare che deve essere usata l'identità assegnata dal sistema. A vicenda con il campo 'userAssignedIdentity'
|
userAssignedIdentity
|
string
|
L'identità assegnata dall'utente da usare per concedere le autorizzazioni nel caso in cui il tipo di identità usato sia UserAssigned
|
CmkKeyVaultProperties
Object
Proprietà dell'insieme di credenziali delle chiavi che ospita la chiave gestita dal cliente
Nome |
Tipo |
Descrizione |
keyUri
|
string
|
URI della chiave gestita dal cliente
|
createdByType
Enumerazione
Tipo di identità che ha creato la risorsa.
Valore |
Descrizione |
User
|
|
Application
|
|
ManagedIdentity
|
|
Key
|
|
CrossRegionRestore
Enumerazione
Flag per indicare se il ripristino tra aree è abilitato nell'insieme di credenziali o meno
Valore |
Descrizione |
Enabled
|
|
Disabled
|
|
CrossSubscriptionRestoreSettings
Object
Impostazioni per le impostazioni di ripristino tra sottoscrizioni
CrossSubscriptionRestoreState
Enumerazione
Valore |
Descrizione |
Enabled
|
|
Disabled
|
|
PermanentlyDisabled
|
|
EnhancedSecurityState
Enumerazione
Valore |
Descrizione |
Invalid
|
|
Enabled
|
|
Disabled
|
|
AlwaysON
|
|
Error
Object
Risposta di errore di gestione delle risorse.
Nome |
Tipo |
Descrizione |
additionalInfo
|
ErrorAdditionalInfo[]
|
Informazioni aggiuntive sull'errore.
|
code
|
string
|
Codice di errore.
|
details
|
Error[]
|
Dettagli dell'errore.
|
message
|
string
|
Messaggio di errore.
|
target
|
string
|
Destinazione dell'errore.
|
ErrorAdditionalInfo
Object
Informazioni aggiuntive sull'errore di gestione delle risorse.
Nome |
Tipo |
Descrizione |
info
|
object
|
Informazioni aggiuntive.
|
type
|
string
|
Tipo di informazioni aggiuntive.
|
IdentityData
Object
Identità per la risorsa.
Nome |
Tipo |
Descrizione |
principalId
|
string
|
ID principale dell'identità della risorsa.
|
tenantId
|
string
|
ID tenant della risorsa.
|
type
|
ResourceIdentityType
|
Tipo di identità gestita usata. Il tipo 'SystemAssigned, UserAssigned' include sia un'identità creata in modo implicito che un set di identità assegnate dall'utente. Il tipo 'None' rimuoverà le identità.
|
userAssignedIdentities
|
<string,
UserIdentity>
|
Elenco delle identità assegnate dall'utente associate alla risorsa. Le chiavi del dizionario delle identità assegnate dall'utente saranno ID risorsa ARM nel formato :'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
IdentityType
Enumerazione
Tipo di identità che deve essere usato per un'operazione.
Valore |
Descrizione |
SystemAssigned
|
|
UserAssigned
|
|
ImmutabilitySettings
Object
Impostazioni di immutabilità dell'insieme di credenziali
ImmutabilityState
Enumerazione
Valore |
Descrizione |
Disabled
|
|
Unlocked
|
|
Locked
|
|
InfrastructureEncryptionState
Enumerazione
Abilitazione/disabilitazione dello stato di crittografia doppia
Valore |
Descrizione |
Enabled
|
|
Disabled
|
|
MonitoringSettings
Object
Impostazioni di monitoraggio dell'insieme di credenziali
MultiUserAuthorization
Enumerazione
Impostazioni MUA dell'insieme di credenziali
Valore |
Descrizione |
Invalid
|
|
Enabled
|
|
Disabled
|
|
PrivateEndpoint
Object
Risorsa di rete endpoint privato collegata alla connessione endpoint privato.
Nome |
Tipo |
Descrizione |
id
|
string
|
Ottiene o imposta l'ID.
|
PrivateEndpointConnection
Object
Proprietà della risposta alla connessione dell'endpoint privato.
Nome |
Tipo |
Descrizione |
groupIds
|
VaultSubResourceType[]
|
ID gruppo per l'endpoint privato
|
privateEndpoint
|
PrivateEndpoint
|
Risorsa di rete endpoint privato collegata alla connessione endpoint privato.
|
privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Ottiene o imposta lo stato della connessione al servizio collegamento privato.
|
provisioningState
|
ProvisioningState
|
Ottiene o imposta lo stato di provisioning della connessione all'endpoint privato.
|
PrivateEndpointConnectionStatus
Enumerazione
Ottiene o imposta lo stato.
Valore |
Descrizione |
Pending
|
|
Approved
|
|
Rejected
|
|
Disconnected
|
|
PrivateEndpointConnectionVaultProperties
Object
Informazioni da archiviare nelle proprietà dell'insieme di credenziali come elemento dell'elenco privateEndpointConnections.
Nome |
Tipo |
Descrizione |
id
|
string
|
Formato delle sottoscrizioni ID/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft. [Servizio]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}.
|
location
|
string
|
Percorso della connessione dell'endpoint privato
|
name
|
string
|
Nome della connessione dell'endpoint privato
|
properties
|
PrivateEndpointConnection
|
Proprietà della risposta alla connessione dell'endpoint privato.
|
type
|
string
|
Tipo, che sarà del formato Microsoft.RecoveryServices/vaults/privateEndpointConnections
|
PrivateLinkServiceConnectionState
Object
Ottiene o imposta lo stato della connessione al servizio collegamento privato.
Nome |
Tipo |
Descrizione |
actionsRequired
|
string
|
Ottiene o imposta le azioni necessarie.
|
description
|
string
|
Ottiene o imposta la descrizione.
|
status
|
PrivateEndpointConnectionStatus
|
Ottiene o imposta lo stato.
|
ProvisioningState
Enumerazione
Ottiene o imposta lo stato di provisioning della connessione all'endpoint privato.
Valore |
Descrizione |
Succeeded
|
|
Deleting
|
|
Failed
|
|
Pending
|
|
PublicNetworkAccess
Enumerazione
per abilitare o disabilitare il traffico di rete in ingresso del provider di risorse dai client pubblici
Valore |
Descrizione |
Enabled
|
|
Disabled
|
|
ResourceIdentityType
Enumerazione
Tipo di identità gestita usata. Il tipo 'SystemAssigned, UserAssigned' include sia un'identità creata in modo implicito che un set di identità assegnate dall'utente. Il tipo 'None' rimuoverà le identità.
Valore |
Descrizione |
SystemAssigned
|
|
None
|
|
UserAssigned
|
|
SystemAssigned, UserAssigned
|
|
ResourceMoveState
Enumerazione
Stato della risorsa dopo l'operazione di spostamento
Valore |
Descrizione |
Unknown
|
|
InProgress
|
|
PrepareFailed
|
|
CommitFailed
|
|
PrepareTimedout
|
|
CommitTimedout
|
|
MoveSucceeded
|
|
Failure
|
|
CriticalFailure
|
|
PartialSuccess
|
|
RestoreSettings
Object
Ripristina impostazioni dell'insieme di credenziali
SecureScoreLevel
Enumerazione
Punteggio di sicurezza dell'insieme di credenziali di Servizi di ripristino
Valore |
Descrizione |
None
|
|
Minimum
|
|
Adequate
|
|
Maximum
|
|
SecuritySettings
Object
Impostazioni di sicurezza dell'insieme di credenziali
Nome |
Tipo |
Descrizione |
immutabilitySettings
|
ImmutabilitySettings
|
Impostazioni di immutabilità di un insieme di credenziali
|
multiUserAuthorization
|
MultiUserAuthorization
|
Impostazioni MUA di un insieme di credenziali
|
softDeleteSettings
|
SoftDeleteSettings
|
Impostazioni di eliminazione temporanea di un insieme di credenziali
|
sourceScanConfiguration
|
SourceScanConfiguration
|
Configurazione dell'analisi di origine dell'insieme di credenziali
|
Sku
Object
Identifica l'identificatore di sistema univoco per ogni risorsa di Azure.
Nome |
Tipo |
Descrizione |
capacity
|
string
|
Capacità sku
|
family
|
string
|
Famiglia sku
|
name
|
SkuName
|
Il nome dello SKU è RS0 (versione 0° di Servizi di ripristino) e il livello è di livello standard. Non influiscono sulla ridondanza dell'archiviazione back-end o su altre impostazioni dell'insieme di credenziali. Per gestire la ridondanza dell'archiviazione, usare backupstorageconfig
|
size
|
string
|
Dimensioni sku
|
tier
|
string
|
Livello SKU.
|
SkuName
Enumerazione
Il nome dello SKU è RS0 (versione 0° di Servizi di ripristino) e il livello è di livello standard. Non influiscono sulla ridondanza dell'archiviazione back-end o su altre impostazioni dell'insieme di credenziali. Per gestire la ridondanza dell'archiviazione, usare backupstorageconfig
Valore |
Descrizione |
Standard
|
|
RS0
|
|
SoftDeleteSettings
Object
Impostazioni di eliminazione temporanea dell'insieme di credenziali
Nome |
Tipo |
Descrizione |
enhancedSecurityState
|
EnhancedSecurityState
|
|
softDeleteRetentionPeriodInDays
|
integer
(int32)
|
Periodo di conservazione dell'eliminazione temporanea in giorni
|
softDeleteState
|
SoftDeleteState
|
|
SoftDeleteState
Enumerazione
Valore |
Descrizione |
Invalid
|
|
Enabled
|
|
Disabled
|
|
AlwaysON
|
|
SourceScanConfiguration
Object
Configurazione dell'analisi di origine dell'insieme di credenziali
Nome |
Tipo |
Descrizione |
sourceScanIdentity
|
AssociatedIdentity
|
Dettagli identità da usare per un'operazione
|
state
|
State
|
|
StandardTierStorageRedundancy
Enumerazione
Impostazione di ridondanza dell'archiviazione di un insieme di credenziali
Valore |
Descrizione |
Invalid
|
|
LocallyRedundant
|
|
GeoRedundant
|
|
ZoneRedundant
|
|
State
Enumerazione
Valore |
Descrizione |
Invalid
|
|
Enabled
|
|
Disabled
|
|
systemData
Object
Metadati relativi alla creazione e all'ultima modifica della risorsa.
Nome |
Tipo |
Descrizione |
createdAt
|
string
(date-time)
|
Timestamp della creazione della risorsa (UTC).
|
createdBy
|
string
|
Identità che ha creato la risorsa.
|
createdByType
|
createdByType
|
Tipo di identità che ha creato la risorsa.
|
lastModifiedAt
|
string
(date-time)
|
Timestamp dell'ultima modifica della risorsa (UTC)
|
lastModifiedBy
|
string
|
Identità che ha modificato l'ultima volta la risorsa.
|
lastModifiedByType
|
createdByType
|
Tipo di identità che ha modificato l'ultima volta la risorsa.
|
TriggerType
Enumerazione
Modalità di attivazione dell'aggiornamento dell'insieme di credenziali.
Valore |
Descrizione |
UserTriggered
|
|
ForcedUpgrade
|
|
UpgradeDetails
Object
Dettagli per l'aggiornamento dell'insieme di credenziali.
Nome |
Tipo |
Descrizione |
endTimeUtc
|
string
(date-time)
|
Ora UTC in cui l'operazione di aggiornamento è terminata.
|
lastUpdatedTimeUtc
|
string
(date-time)
|
Ora UTC in cui lo stato dell'operazione di aggiornamento è stato aggiornato per l'ultimo aggiornamento.
|
message
|
string
|
Messaggio all'utente contenente informazioni sull'operazione di aggiornamento.
|
operationId
|
string
|
ID dell'operazione di aggiornamento dell'insieme di credenziali.
|
previousResourceId
|
string
|
ID risorsa dell'insieme di credenziali prima dell'aggiornamento.
|
startTimeUtc
|
string
(date-time)
|
Ora UTC in cui è stata avviata l'operazione di aggiornamento.
|
status
|
VaultUpgradeState
|
Stato dell'operazione di aggiornamento dell'insieme di credenziali.
|
triggerType
|
TriggerType
|
Modalità di attivazione dell'aggiornamento dell'insieme di credenziali.
|
upgradedResourceId
|
string
|
ID risorsa dell'insieme di credenziali aggiornato.
|
UserIdentity
Object
Identità della risorsa gestita dall'utente del servizio.
Nome |
Tipo |
Descrizione |
clientId
|
string
|
ID client dell'identità assegnata dall'utente.
|
principalId
|
string
|
ID principale dell'identità assegnata dall'utente.
|
Vault
Object
Informazioni sulle risorse, restituite dal provider di risorse.
Nome |
Tipo |
Descrizione |
etag
|
string
|
etag per la risorsa.
|
id
|
string
|
ID risorsa completo per la risorsa. Ad esempio - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
IdentityData
|
Identità per la risorsa.
|
location
|
string
|
Posizione geografica in cui risiede la risorsa
|
name
|
string
|
Nome della risorsa
|
properties
|
VaultProperties
|
Proprietà dell'insieme di credenziali.
|
sku
|
Sku
|
Identifica l'identificatore di sistema univoco per ogni risorsa di Azure.
|
systemData
|
systemData
|
Metadati di Azure Resource Manager contenenti le informazioni createdBy e modifiedBy.
|
tags
|
object
|
Tag di risorsa.
|
type
|
string
|
Tipo di risorsa. Ad esempio, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
VaultPrivateEndpointState
Enumerazione
Stato dell'endpoint privato per il backup.
Valore |
Descrizione |
None
|
|
Enabled
|
|
VaultProperties
Object
Proprietà dell'insieme di credenziali.
Nome |
Tipo |
Descrizione |
backupStorageVersion
|
BackupStorageVersion
|
Versione dell'archiviazione di backup
|
bcdrSecurityLevel
|
BCDRSecurityLevel
|
Livelli di sicurezza dell'insieme di credenziali di Servizi di ripristino per la continuità aziendale e il ripristino di emergenza
|
encryption
|
VaultPropertiesEncryption
|
Dettagli della chiave gestita dal cliente della risorsa.
|
monitoringSettings
|
MonitoringSettings
|
Impostazioni di monitoraggio dell'insieme di credenziali
|
moveDetails
|
VaultPropertiesMoveDetails
|
Dettagli dell'operazione di spostamento più recente eseguita sulla risorsa di Azure
|
moveState
|
ResourceMoveState
|
Stato della risorsa dopo l'operazione di spostamento
|
privateEndpointConnections
|
PrivateEndpointConnectionVaultProperties[]
|
Elenco della connessione all'endpoint privato.
|
privateEndpointStateForBackup
|
VaultPrivateEndpointState
|
Stato dell'endpoint privato per il backup.
|
privateEndpointStateForSiteRecovery
|
VaultPrivateEndpointState
|
Stato dell'endpoint privato per site recovery.
|
provisioningState
|
string
|
Stato di provisioning.
|
publicNetworkAccess
|
PublicNetworkAccess
|
per abilitare o disabilitare il traffico di rete in ingresso del provider di risorse dai client pubblici
|
redundancySettings
|
VaultPropertiesRedundancySettings
|
Impostazioni di ridondanza di un insieme di credenziali
|
resourceGuardOperationRequests
|
string[]
|
ResourceGuardOperationRequests su cui verrà eseguito il controllo LAC
|
restoreSettings
|
RestoreSettings
|
Ripristina impostazioni dell'insieme di credenziali
|
secureScore
|
SecureScoreLevel
|
Punteggio di sicurezza dell'insieme di credenziali di Servizi di ripristino
|
securitySettings
|
SecuritySettings
|
Impostazioni di sicurezza dell'insieme di credenziali
|
upgradeDetails
|
UpgradeDetails
|
Dettagli per l'aggiornamento dell'insieme di credenziali.
|
VaultPropertiesEncryption
Object
Dettagli della chiave gestita dal cliente della risorsa.
Nome |
Tipo |
Descrizione |
infrastructureEncryption
|
InfrastructureEncryptionState
|
Abilitazione/disabilitazione dello stato di crittografia doppia
|
kekIdentity
|
CmkKekIdentity
|
Dettagli dell'identità usata per la chiave gestita dal cliente
|
keyVaultProperties
|
CmkKeyVaultProperties
|
Proprietà dell'insieme di credenziali delle chiavi che ospita la chiave gestita dal cliente
|
VaultPropertiesMoveDetails
Object
Dettagli dell'operazione di spostamento più recente eseguita sulla risorsa di Azure
Nome |
Tipo |
Descrizione |
completionTimeUtc
|
string
(date-time)
|
Ora di fine dell'operazione di spostamento delle risorse
|
operationId
|
string
|
OperationId dell'operazione di spostamento delle risorse
|
sourceResourceId
|
string
|
Risorsa di origine dell'operazione di spostamento delle risorse
|
startTimeUtc
|
string
(date-time)
|
Ora di inizio dell'operazione di spostamento delle risorse
|
targetResourceId
|
string
|
Risorsa di destinazione dell'operazione di spostamento delle risorse
|
VaultPropertiesRedundancySettings
Object
Impostazioni di ridondanza di un insieme di credenziali
Nome |
Tipo |
Descrizione |
crossRegionRestore
|
CrossRegionRestore
|
Flag per indicare se il ripristino tra aree è abilitato nell'insieme di credenziali o meno
|
standardTierStorageRedundancy
|
StandardTierStorageRedundancy
|
Impostazione di ridondanza dell'archiviazione di un insieme di credenziali
|
VaultSubResourceType
Enumerazione
Tipo di sottorisorsa per l'insieme di credenziali AzureBackup, AzureBackup_secondary o AzureSiteRecovery
Valore |
Descrizione |
AzureBackup
|
|
AzureBackup_secondary
|
|
AzureSiteRecovery
|
|
VaultUpgradeState
Enumerazione
Stato dell'operazione di aggiornamento dell'insieme di credenziali.
Valore |
Descrizione |
Unknown
|
|
InProgress
|
|
Upgraded
|
|
Failed
|
|