Skip to content

Commit 83fefdc

Browse files
Merge branch 'MicrosoftDocs:main' into master
2 parents fa87dfb + 81661cc commit 83fefdc

9 files changed

+12
-154
lines changed

articles/active-directory/develop/msal-net-token-cache-serialization.md

Lines changed: 1 addition & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -548,149 +548,7 @@ A product-quality, file-based token cache serializer for public client applicati
548548
549549
#### Dual token cache serialization (MSAL unified cache and ADAL v3)
550550

551-
If you want to implement token cache serialization with the unified cache format (common to ADAL.NET 4.x, MSAL.NET 2.x, and other MSALs of the same generation or older, on the same platform), take a look at the following code:
552-
553-
```csharp
554-
string appLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location;
555-
string cacheFolder = Path.GetFullPath(appLocation) + @"..\..\..\..");
556-
string adalV3cacheFileName = Path.Combine(cacheFolder, "cacheAdalV3.bin");
557-
string unifiedCacheFileName = Path.Combine(cacheFolder, "unifiedCache.bin");
558-
559-
IPublicClientApplication app;
560-
app = PublicClientApplicationBuilder.Create(clientId)
561-
.Build();
562-
FilesBasedTokenCacheHelper.EnableSerialization(app.UserTokenCache,
563-
unifiedCacheFileName,
564-
adalV3cacheFileName);
565-
566-
```
567-
568-
This time, the helper class is defined as:
569-
570-
```csharp
571-
using System;
572-
using System.IO;
573-
using System.Security.Cryptography;
574-
using Microsoft.Identity.Client;
575-
576-
namespace CommonCacheMsalV3
577-
{
578-
/// <summary>
579-
/// Simple persistent cache implementation of the dual cache serialization (ADAL v3 legacy
580-
/// and unified cache format) for a desktop applications (from MSAL 2.x)
581-
/// </summary>
582-
static class FilesBasedTokenCacheHelper
583-
{
584-
/// <summary>
585-
/// Enables the serialization of the token cache
586-
/// </summary>
587-
/// <param name="adalV3CacheFileName">File name where the cache is serialized with the
588-
/// ADAL v3 token cache format. Can
589-
/// be <c>null</c> if you don't want to implement the legacy ADAL v3 token cache
590-
/// serialization in your MSAL 2.x+ application</param>
591-
/// <param name="unifiedCacheFileName">File name where the cache is serialized
592-
/// with the unified cache format, common to
593-
/// ADAL v4 and MSAL v2 and later, and also across ADAL/MSAL on the same platform.
594-
/// Should not be <c>null</c></param>
595-
/// <returns></returns>
596-
public static void EnableSerialization(ITokenCache tokenCache, string unifiedCacheFileName, string adalV3CacheFileName)
597-
{
598-
UnifiedCacheFileName = unifiedCacheFileName;
599-
AdalV3CacheFileName = adalV3CacheFileName;
600-
601-
tokenCache.SetBeforeAccess(BeforeAccessNotification);
602-
tokenCache.SetAfterAccess(AfterAccessNotification);
603-
}
604-
605-
/// <summary>
606-
/// File path where the token cache is serialized with the unified cache format
607-
/// (ADAL.NET v4, MSAL.NET v3)
608-
/// </summary>
609-
public static string UnifiedCacheFileName { get; private set; }
610-
611-
/// <summary>
612-
/// File path where the token cache is serialized with the legacy ADAL v3 format
613-
/// </summary>
614-
public static string AdalV3CacheFileName { get; private set; }
615-
616-
private static readonly object FileLock = new object();
617-
618-
public static void BeforeAccessNotification(TokenCacheNotificationArgs args)
619-
{
620-
lock (FileLock)
621-
{
622-
args.TokenCache.DeserializeAdalV3(ReadFromFileIfExists(AdalV3CacheFileName));
623-
try
624-
{
625-
args.TokenCache.DeserializeMsalV3(ReadFromFileIfExists(UnifiedCacheFileName));
626-
}
627-
catch(Exception ex)
628-
{
629-
// Compatibility with the MSAL v2 cache if you used one
630-
args.TokenCache.DeserializeMsalV2(ReadFromFileIfExists(UnifiedCacheFileName));
631-
}
632-
}
633-
}
634-
635-
public static void AfterAccessNotification(TokenCacheNotificationArgs args)
636-
{
637-
// if the access operation resulted in a cache update
638-
if (args.HasStateChanged)
639-
{
640-
lock (FileLock)
641-
{
642-
WriteToFileIfNotNull(UnifiedCacheFileName, args.TokenCache.SerializeMsalV3());
643-
if (!string.IsNullOrWhiteSpace(AdalV3CacheFileName))
644-
{
645-
WriteToFileIfNotNull(AdalV3CacheFileName, args.TokenCache.SerializeAdalV3());
646-
}
647-
}
648-
}
649-
}
650-
651-
/// <summary>
652-
/// Read the content of a file if it exists
653-
/// </summary>
654-
/// <param name="path">File path</param>
655-
/// <returns>Content of the file (in bytes)</returns>
656-
private static byte[] ReadFromFileIfExists(string path)
657-
{
658-
byte[] protectedBytes = (!string.IsNullOrEmpty(path) && File.Exists(path))
659-
? File.ReadAllBytes(path) : null;
660-
byte[] unprotectedBytes = encrypt ?
661-
((protectedBytes != null) ? ProtectedData.Unprotect(protectedBytes, null, DataProtectionScope.CurrentUser) : null)
662-
: protectedBytes;
663-
return unprotectedBytes;
664-
}
665-
666-
/// <summary>
667-
/// Writes a blob of bytes to a file. If the blob is <c>null</c>, deletes the file
668-
/// </summary>
669-
/// <param name="path">path to the file to write</param>
670-
/// <param name="blob">Blob of bytes to write</param>
671-
private static void WriteToFileIfNotNull(string path, byte[] blob)
672-
{
673-
if (blob != null)
674-
{
675-
byte[] protectedBytes = encrypt
676-
? ProtectedData.Protect(blob, null, DataProtectionScope.CurrentUser)
677-
: blob;
678-
File.WriteAllBytes(path, protectedBytes);
679-
}
680-
else
681-
{
682-
File.Delete(path);
683-
}
684-
}
685-
686-
// Change if you want to test with an unencrypted blob (this is a JSON format)
687-
private static bool encrypt = true;
688-
}
689-
}
690-
```
691-
692-
For more details see the sample: https://github.com/Azure-Samples/active-directory-dotnet-v1-to-v2/tree/master/TokenCacheMigration/ADAL2MSAL
693-
551+
If you want to implement token cache serialization with the unified cache format (common to ADAL.NET 4.x, MSAL.NET 2.x, and other MSALs of the same generation or older, on the same platform), take a look at the following sample: https://github.com/Azure-Samples/active-directory-dotnet-v1-to-v2/tree/master/TokenCacheMigration/ADAL2MSAL.
694552
695553
---
696554

articles/active-directory/governance/lifecycle-workflow-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ For Microsoft Graph the parameters for the **Run a Custom Task Extension** task
309309

310310
```Example for usage within the workflow
311311
{
312-
"category": "joiner,leaver",
312+
"category": "joiner,leaver",
313313
"description": "Run a Custom Task Extension to call-out to an external system.",
314314
"displayName": "Run a Custom Task Extension",
315315
"isEnabled": true,
@@ -318,7 +318,7 @@ For Microsoft Graph the parameters for the **Run a Custom Task Extension** task
318318
"arguments": [
319319
{
320320
"name": "customTaskExtensionID",
321-
"value": ""<ID of your Custom Task Extension>""
321+
"value": "<ID of your Custom Task Extension>"
322322
}
323323
]
324324
}

articles/backup/backup-azure-vms-enhanced-policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Follow these steps:
6868
6. Click **Create**.
6969

7070
>[!Note]
71-
>- The support for Enhanced policy is available in all Azure public regions, and not in US Sovereign regions.
71+
>- The support for Enhanced policy is available in all Azure Public and US Government regions.
7272
>- We support Enhanced policy configuration through [Recovery Services vault](./backup-azure-arm-vms-prepare.md) and [VM Manage blade](./backup-during-vm-creation.md#start-a-backup-after-creating-the-vm) only. Configuration through Backup center is currently not supported.
7373
>- For hourly backups, the last backup of the day is transferred to vault. If backup fails, the first backup of the next day is transferred to vault.
7474
>- Enhanced policy is only available to unprotected VMs that are new to Azure Backup. Note that Azure VMs that are protected with existing policy can't be moved to Enhanced policy.
@@ -79,4 +79,4 @@ Follow these steps:
7979
- [Run a backup immediately](./backup-azure-vms-first-look-arm.md#run-a-backup-immediately)
8080
- [Verify Backup job status](./backup-azure-arm-vms-prepare.md#verify-backup-job-status)
8181
- [Restore Azure virtual machines](./backup-azure-arm-restore-vms.md#restore-disks)
82-
- [Troubleshoot VM backup](backup-azure-vms-troubleshoot.md#usererrormigrationfromtrustedlaunchvm-tonontrustedvmnotallowed)
82+
- [Troubleshoot VM backup](backup-azure-vms-troubleshoot.md#usererrormigrationfromtrustedlaunchvm-tonontrustedvmnotallowed)

articles/backup/encryption-at-rest-with-cmk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In this article, you'll learn how to:
3434

3535
- This feature isn't related to [Azure Disk Encryption](../virtual-machines/disk-encryption-overview.md), which uses guest-based encryption of a VM's disk using BitLocker (for Windows) and DM-Crypt (for Linux).
3636

37-
- The Recovery Services vault can be encrypted only with keys stored in Azure Key Vault, located in the **same region**. Also, keys must be **RSA keys** only and should be in **enabled** state.
37+
- The Recovery Services vault can be encrypted only with keys stored in Azure Key Vault, located in the **same region**. Also, keys must be [supported](../key-vault/keys/about-keys.md#key-types-and-protection-methods) **RSA keys** only and should be in **enabled** state.
3838

3939
- Moving CMK encrypted Recovery Services vault across Resource Groups and Subscriptions isn't currently supported.
4040
- Recovery Services vaults encrypted with customer-managed keys currently don't support cross-region restore of backed-up instances.

articles/cosmos-db/nosql/how-to-time-to-live.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ container.replace_item(
393393

394394
## Disable time to live using an SDK
395395

396-
To disable time to live on a container and stop the background process from checking for expired items, the `DefaultTimeToLive` property on the container should be deleted. Deleting this property is different from setting it to -1. When you set it to -1, new items added to the container will live forever, however you can override this value on specific items in the container. When you remove the TTL property from the container the items will never expire, even if there are they have explicitly overridden the previous default TTL value.
396+
To disable time to live on a container and stop the background process from checking for expired items, the `DefaultTimeToLive` property on the container should be deleted. Deleting this property is different from setting it to -1. When you set it to -1, new items added to the container will live forever, however you can override this value on specific items in the container. When you remove the TTL property from the container the items will never expire, even if they have explicitly overridden the previous default TTL value.
397397

398398
### [.NET SDK v3](#tab/dotnet-sdk-v3)
399399

articles/defender-for-cloud/defender-for-devops-introduction.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Defender for DevOps helps unify, strengthen and manage multi-pipeline DevOps sec
2727
| Release state: | Preview<br>The [Azure Preview Supplemental Terms](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) include other legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. |
2828
| Clouds | :::image type="icon" source="./media/icons/yes-icon.png"::: Commercial clouds<br>:::image type="icon" source="./media/icons/no-icon.png"::: National (Azure Government, Azure China 21Vianet) |
2929
| Regions: | Central US |
30-
| Source Code Management | [Azure DevOps](https://portal.azure.com/#home) |
31-
| Systems | [GitHub](https://github.com/) |
30+
| Source Code Management Systems | [Azure DevOps](https://portal.azure.com/#home) <br>[GitHub](https://github.com/) supported versions: GitHub Free, Pro, Team, and GitHub Enterprise Cloud |
3231
| Required permissions: | <br> **Azure account** - with permissions to sign into Azure portal. <br> **Contributor** - on the relevant Azure subscription. <br> **Organization Administrator** - in GitHub. <br> **Security Admin role** - in Defender for Cloud. |
3332

3433
## Manage your DevOps environments in Defender for Cloud

articles/defender-for-cloud/quickstart-onboard-github.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ By connecting your GitHub repositories to Defender for Cloud, you'll extend Defe
3131
| Release state: | Preview <br> The [Azure Preview Supplemental Terms](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) include other legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. |
3232
| Pricing: | For pricing please see the Defender for Cloud [pricing page](https://azure.microsoft.com/pricing/details/defender-for-cloud/?v=17.23h#pricing).
3333
| Required permissions: | **- Azure account:** with permissions to sign into Azure portal <br> **- Contributor:** on the Azure subscription where the connector will be created <br> **- Security Admin Role:** in Defender for Cloud <br> **- Organization Administrator:** in GitHub |
34+
| GitHub supported versions: | GitHub Free, Pro, Team, and GitHub Enterprise Cloud |
3435
| Regions: | Central US |
3536
| Clouds: | :::image type="icon" source="media/quickstart-onboard-github/check-yes.png" border="false"::: Commercial clouds <br> :::image type="icon" source="media/quickstart-onboard-github/x-no.png" border="false"::: National (Azure Government, Azure China 21Vianet) |
3637

articles/machine-learning/how-to-deploy-online-endpoints.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ The preceding YAML uses a general-purpose type (`Standard_DS2_v2`) and a non-GPU
371371
For supported general-purpose and GPU instance types, see [Managed online endpoints supported VM SKUs](reference-managed-online-endpoints-vm-sku-list.md). For a list of Azure Machine Learning CPU and GPU base images, see [Azure Machine Learning base images](https://github.com/Azure/AzureML-Containers).
372372

373373
> [!NOTE]
374-
> To use Kubernetes instead of managed endpoints as a compute target, see [Introduction to Kubermentes compute target](./how-to-attach-kubernetes-anywhere.md)
374+
> To use Kubernetes instead of managed endpoints as a compute target, see [Introduction to Kubernetes compute target](./how-to-attach-kubernetes-anywhere.md)
375375

376376
### Use more than one model
377377

@@ -968,4 +968,4 @@ To learn more, review these articles:
968968
- [Access Azure resources from an online endpoint with a managed identity](how-to-access-resources-from-endpoints-managed-identities.md)
969969
- [Troubleshoot online endpoints deployment](how-to-troubleshoot-online-endpoints.md)
970970
- [Enable network isolation with managed online endpoints](how-to-secure-online-endpoint.md)
971-
- [View costs for an Azure Machine Learning managed online endpoint](how-to-view-online-endpoints-costs.md)
971+
- [View costs for an Azure Machine Learning managed online endpoint](how-to-view-online-endpoints-costs.md)

articles/machine-learning/migrate-to-v2-managed-online-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Use the following steps to run the scripts:
8080
> The new endpoint created by the scripts will be created under the same workspace.
8181
8282
1. Use a bash shell to run the scripts. For example, a terminal session on Linux or the Windows Subsystem for Linux (WSL).
83-
2. Install [Python SDK V1](/python/api/overview/azure/ml/install) to run the python script.
83+
2. Install [Python SDK V1](/python/api/overview/azure/ml/install) to run the Python script.
8484
3. Install [Azure CLI](/cli/azure/install-azure-cli).
8585
4. Clone [the repository](https://github.com/Azure/azureml-examples/tree/main/cli/endpoints/online/managed/migration) to your local env. For example, `git clone https://github.com/Azure/azureml-examples`.
8686
5. Edit the following values in the `migrate-service.sh` file. Replace the values with ones that apply to your configuration.

0 commit comments

Comments
 (0)