dotnet / dotnet/AspNetCore.Docs
Broken code for connecting to blob via a client object
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 97
Description
The docs provide the following sample for how to connect to a blob storage provider
``` csharp
string connectionString = "";
string containerName = "my-key-container";
BlobContainerClient container = new BlobContainerClient(connectionString, containerName);
// optional - provision the container automatically
await container.CreateIfNotExistsAsync();
services.AddDataProtection()
.PersistKeysToAzureBlobStorage(container, "keys.xml");
```
However, the package at https://github.com/Azure/azure-sdk-for-net/blob/Azure.Extensions.AspNetCore.DataProtection.Blobs_1.2.0/sdk/extensions/Azure.Extensions.AspNetCore.DataProtection.Blobs/src/AzureStorageBlobDataProtectionBuilderExtensions.cs does not expose a extension method with BlobContainerClient as a parameter. The closest match appears to be BlobClient, although I'm not yet sure this behaves the same.
Also, I recommend including the explict namespace here, as there are multiple packages that expose this extension method currently.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 59850a13-1322-0c54-9fd3-75ce837c2b1a
* Version Independent ID: 7d481dae-d27d-909c-a35d-bad66c7508d2
* Content: [Key storage providers in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers?view=aspnetcore-5.0&tabs=visual-studio)
* Content Source: [aspnetcore/security/data-protection/implementation/key-storage-providers.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/data-protection/implementation/key-storage-providers.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **riande**
Contributor guide
Assessment
This issue has not been assessed yet.