Skip to content

Commit 725faaa

Browse files
committed
add currentProfile to the bicepConfig
1 parent 37b406e commit 725faaa

File tree

2 files changed

+46
-32
lines changed

2 files changed

+46
-32
lines changed

articles/azure-resource-manager/bicep/bicep-config-modules.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Module setting for Bicep config
33
description: Describes how to customize configuration values for modules in Bicep deployments.
44
ms.topic: conceptual
5-
ms.date: 04/08/2022
5+
ms.date: 01/09/2023
66
---
77

88
# Add module settings in the Bicep config file
@@ -122,7 +122,49 @@ You can override the public module registry alias definition in the bicepconfig.
122122

123123
## Credentials for publishing/restoring modules
124124

125-
To [publish](bicep-cli.md#publish) modules to a private module registry or to [restore](bicep-cli.md#restore) external modules to the local cache, the account must have the correct permissions to access the registry. You can configure the credential precedence for authenticating to the registry. By default, Bicep uses the credentials from the user authenticated in Azure CLI or Azure PowerShell. To customize the credential precedence, see [Add credential precedence to Bicep config](bicep-config.md#credential-precedence).
125+
To [publish](bicep-cli.md#publish) modules to a private module registry or to [restore](bicep-cli.md#restore) external modules to the local cache, the account must have the correct permissions to access the registry. You can configure the profile and the credential precedence for authenticating to the registry. By default, Bicep uses the `AzureCloud` profile and the credentials from the user authenticated in Azure CLI or Azure PowerShell. You can customize `currentProfile` and `credentialPrecedence` in the config file.
126+
127+
```json
128+
{
129+
"cloud": {
130+
"currentProfile": "AzureCloud",
131+
"profiles": {
132+
"AzureCloud": {
133+
"resourceManagerEndpoint": "https://management.azure.com",
134+
"activeDirectoryAuthority": "https://login.microsoftonline.com"
135+
},
136+
"AzureChinaCloud": {
137+
"resourceManagerEndpoint": "https://management.chinacloudapi.cn",
138+
"activeDirectoryAuthority": "https://login.chinacloudapi.cn"
139+
},
140+
"AzureUSGovernment": {
141+
"resourceManagerEndpoint": "https://management.usgovcloudapi.net",
142+
"activeDirectoryAuthority": "https://login.microsoftonline.us"
143+
}
144+
},
145+
"credentialPrecedence": [
146+
"AzureCLI",
147+
"AzurePowerShell"
148+
]
149+
}
150+
}
151+
```
152+
153+
The available national profiles are:
154+
155+
- AzureChinaCloud
156+
- AzureUSGovernment
157+
158+
The available credential types are:
159+
160+
- AzureCLI
161+
- AzurePowerShell
162+
- Environment
163+
- ManagedIdentity
164+
- VisualStudio
165+
- VisualStudioCode
166+
167+
[!INCLUDE [vscode authentication](../../../includes/resource-manager-vscode-authentication.md)]
126168

127169
## Next steps
128170

articles/azure-resource-manager/bicep/bicep-config.md

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Bicep config file
33
description: Describes the configuration file for your Bicep deployments
44
ms.topic: conceptual
5-
ms.date: 12/06/2022
5+
ms.date: 01/09/2023
66
---
77

88
# Configure your Bicep environment
@@ -17,38 +17,10 @@ To create a `bicepconfig.json` file in Visual Studio Code, open the Command Pale
1717

1818
## Available settings
1919

20-
When working with [modules](modules.md), you can add aliases for module paths. These aliases simplify your Bicep file because you don't have to repeat complicated paths. For more information, see [Add module settings to Bicep config](bicep-config-modules.md).
20+
When working with [modules](modules.md), you can add aliases for module paths. These aliases simplify your Bicep file because you don't have to repeat complicated paths. You can also configure cloud profile and credential precedence for authenticating to Azure from Bicep CLI and Visual Studio Code. The credentials are used to publish modules to registries and to restore external modules to the local cache when using the insert resource function.For more information, see [Add module settings to Bicep config](bicep-config-modules.md).
2121

2222
The [Bicep linter](linter.md) checks Bicep files for syntax errors and best practice violations. You can override the default settings for the Bicep file validation by modifying `bicepconfig.json`. For more information, see [Add linter settings to Bicep config](bicep-config-linter.md).
2323

24-
You can also configure the credential precedence for authenticating to Azure from Bicep CLI and Visual Studio Code. The credentials are used to publish modules to registries and to restore external modules to the local cache when using the insert resource function.
25-
26-
## Credential precedence
27-
28-
You can configure the credential precedence for authenticating to the registry. By default, Bicep uses the credentials from the user authenticated in Azure CLI or Azure PowerShell. To customize the credential precedence, add `cloud` and `credentialPrecedence` elements to the config file.
29-
30-
```json
31-
{
32-
"cloud": {
33-
"credentialPrecedence": [
34-
"AzureCLI",
35-
"AzurePowerShell"
36-
]
37-
}
38-
}
39-
```
40-
41-
The available credential types are:
42-
43-
- AzureCLI
44-
- AzurePowerShell
45-
- Environment
46-
- ManagedIdentity
47-
- VisualStudio
48-
- VisualStudioCode
49-
50-
[!INCLUDE [vscode authentication](../../../includes/resource-manager-vscode-authentication.md)]
51-
5224
## Intellisense
5325

5426
The Bicep extension for Visual Studio Code supports intellisense for your `bicepconfig.json` file. Use the intellisense to discover available properties and values.

0 commit comments

Comments
 (0)