Skip to content

Commit

Permalink
Support resource type id of App Configuration (Azure#19660)
Browse files Browse the repository at this point in the history
* update

* update doc

* update code
  • Loading branch information
dingmeng-xue authored Sep 27, 2022
1 parent 33ca576 commit 86ba240
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/Accounts/Accounts/Rest/InvokeAzRestMethodCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ private string MatchResourceId(IAzureContext context, string authority, out stri
targetResourceIdKey = AzureEnvironment.Endpoint.DataLakeEndpointResourceId;
return env.DataLakeEndpointResourceId;
}
if (HasSameEndpointSuffix(authority, env.ExtendedProperties[AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointSuffix]))
{
targetResourceIdKey = AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId;
return env.ExtendedProperties[AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId];
}
return null;
}

Expand Down
1 change: 1 addition & 0 deletions src/Accounts/Accounts/Token/GetAzureRmAccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class GetAzureRmAccessTokenCommand : AzureRMCmdlet
SupportedResourceNames.AadGraph,
SupportedResourceNames.MSGraph,
SupportedResourceNames.AnalysisServices,
SupportedResourceNames.AppConfiguration,
SupportedResourceNames.Arm,
SupportedResourceNames.Attestation,
SupportedResourceNames.Batch,
Expand Down
4 changes: 3 additions & 1 deletion src/Accounts/Accounts/Utilities/SupportedResourceNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal class SupportedResourceNames
public const string Storage = "Storage";
public const string Synapse = "Synapse";
public const string ManagedHsm = "ManagedHsm";
public const string AppConfiguration = "AppConfiguration";

internal static Dictionary<string, string> ResourceNameMap;
internal static Dictionary<string, string> DataPlaneResourceNameMap;
Expand All @@ -54,7 +55,8 @@ static SupportedResourceNames()
{ OperationalInsights, AzureEnvironment.ExtendedEndpoint.OperationalInsightsEndpointResourceId },
{ Storage, "https://storage.azure.com/" }, //OAuth scope/resource id for Storage, does not add it to ExtenedEndpoint to avoid confusion with StorageEndpointSuffix
{ Synapse, AzureEnvironment.ExtendedEndpoint.AzureSynapseAnalyticsEndpointResourceId },
{ ManagedHsm, AzureEnvironment.ExtendedEndpoint.ManagedHsmServiceEndpointResourceId }
{ ManagedHsm, AzureEnvironment.ExtendedEndpoint.ManagedHsmServiceEndpointResourceId },
{ AppConfiguration, AzureEnvironment.ExtendedEndpoint.AzureAppConfigurationEndpointResourceId }
};

ResourceNameMap = new Dictionary<string, string>(DataPlaneResourceNameMap);
Expand Down
10 changes: 5 additions & 5 deletions src/Accounts/Accounts/help/Get-AzAccessToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Get access token of Microsoft Graph endpoint for current account
The credentials, account, tenant, and subscription used for communication with Azure.

```yaml
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

Expand All @@ -68,10 +68,10 @@ Accept wildcard characters: False
```
### -ResourceTypeName
Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified.
Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified.
```yaml
Type: System.String
Type: String
Parameter Sets: KnownResourceTypeName
Aliases:

Expand All @@ -86,7 +86,7 @@ Accept wildcard characters: False
Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'.
```yaml
Type: System.String
Type: String
Parameter Sets: ResourceUrl
Aliases: Resource, ResourceUri

Expand All @@ -101,7 +101,7 @@ Accept wildcard characters: False
Optional Tenant Id. Use tenant id of default context if not specified.
```yaml
Type: System.String
Type: String
Parameter Sets: (All)
Aliases:

Expand Down

0 comments on commit 86ba240

Please sign in to comment.