Azure Provisioning RecoveryServicesBackup client library for .NET - version 1.0.0-beta.1

Azure.Provisioning.RecoveryServicesBackup simplifies declarative resource provisioning in .NET.

Getting started

Install the package

Install the client library for .NET with NuGet:

dotnet add package Azure.Provisioning.RecoveryServicesBackup --prerelease

Prerequisites

You must have an Azure subscription.

Authenticate the Client

Key concepts

This library allows you to specify your infrastructure in a declarative style using .NET. You can then use azd to deploy your infrastructure to Azure directly without needing to write or maintain Bicep or ARM templates.

Examples

Create a daily VM backup policy

The vault name is included in the policy name because the Recovery Services vault is managed by a separate resource provider package.

Infrastructure infra = new();
DateTimeOffset backupTime = DateTimeOffset.Parse("2026-01-01T02:00:00Z");

BackupProtectionPolicy policy =
    new(nameof(policy), BackupProtectionPolicy.ResourceVersions.V2026_01_01)
    {
        Name = "example-vault/daily-vm-policy",
        Properties = new IaasVmProtectionPolicy
        {
            SchedulePolicy = new SimpleSchedulePolicy
            {
                ScheduleRunFrequency = ScheduleRunType.Daily,
                ScheduleRunTimes = { backupTime },
            },
            RetentionPolicy = new LongTermRetentionPolicy
            {
                DailySchedule = new DailyRetentionSchedule
                {
                    RetentionTimes = { backupTime },
                    RetentionDuration = new RetentionDuration
                    {
                        Count = 7,
                        DurationType = RetentionDurationType.Days,
                    },
                },
            },
            TimeZone = "UTC",
        },
    };
infra.Add(policy);

Troubleshooting

Next steps

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (for example, label, comment). Follow the instructions provided by the bot. You'll only need to do this action once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any other questions or comments.