-
Notifications
You must be signed in to change notification settings - Fork 90
Bicep support for 'custom' azure environment #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Development
Are you sure you want to change the base?
Changes from all commits
3189555
3c53d89
ed97273
eb9a278
b6cda00
eaa483b
837ec8f
625d733
fac697c
88970c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,14 +5,12 @@ targetScope = 'subscription' | |||||||||
| - Region must align to the target cloud environment''') | ||||||||||
| param location string | ||||||||||
|
|
||||||||||
| @description('''The target Azure Cloud environment. | ||||||||||
| - Accepted values are: AzureCloud, AzureUSGovernment | ||||||||||
| - Default is AzureCloud''') | ||||||||||
| @allowed([ | ||||||||||
| 'AzureCloud' | ||||||||||
| 'AzureUSGovernment' | ||||||||||
| 'public' | ||||||||||
| 'usgovernment' | ||||||||||
| 'custom' | ||||||||||
| ]) | ||||||||||
| param cloudEnvironment string | ||||||||||
| param cloudEnvironment string = az.environment().name == 'AzureCloud' ? 'public' : (az.environment().name == 'AzureUSGovernment' ? 'usgovernment' : 'custom') | ||||||||||
|
|
||||||||||
| @description('''The name of the application to be deployed. | ||||||||||
| - Name may only contain letters and numbers | ||||||||||
|
|
@@ -126,13 +124,27 @@ param deploySpeechService bool | |||||||||
| - Default is false''') | ||||||||||
| param deployVideoIndexerService bool | ||||||||||
|
|
||||||||||
| // --- Custom Azure Environment Parameters (for 'custom' azureEnvironment) --- | ||||||||||
| @description('Custom blob storage URL suffix, e.g. blob.core.usgovcloudapi.net') | ||||||||||
| param customBlobStorageSuffix string = 'blob.${az.environment().suffixes.storage}' | ||||||||||
| @description('Custom Graph API URL, e.g. https://graph.microsoft.us') | ||||||||||
| param customGraphUrl string = az.environment().graph | ||||||||||
| @description('Custom Identity URL, e.g. https://login.microsoftonline.us') | ||||||||||
| param customIdentityUrl string = az.environment().authentication.loginEndpoint | ||||||||||
| @description('Custom Resource Manager URL, e.g. https://management.usgovcloudapi.net') | ||||||||||
| param customResourceManagerUrl string = az.environment().resourceManager | ||||||||||
| @description('Custom Cognitive Services scope ex: https://cognitiveservices.azure.com/.default') | ||||||||||
| param customCognitiveServicesScope string = 'https://cognitiveservices.azure.com/.default' | ||||||||||
|
Comment on lines
+136
to
+137
|
||||||||||
| @description('Custom Cognitive Services scope ex: https://cognitiveservices.azure.com/.default') | |
| param customCognitiveServicesScope string = 'https://cognitiveservices.azure.com/.default' | |
| @description('Custom Cognitive Services scope, e.g. https://cognitiveservices.azure.com/.default (public), https://cognitiveservices.azure.us/.default (US Gov)') | |
| param customCognitiveServicesScope string = az.environment().name == 'AzureUSGovernment' ? 'https://cognitiveservices.azure.us/.default' : 'https://cognitiveservices.azure.com/.default' |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for customSearchResourceUrl is hardcoded to 'https://search.azure.com', which is the public Azure cloud endpoint. This default will be incorrect for users deploying to AzureUSGovernment or other custom clouds, as they use different search endpoints (e.g., 'https://search.azure.us' for US Government). Consider making this value conditional based on the cloud environment or documenting that users must override this parameter when deploying to non-public clouds.
| param customSearchResourceUrl string = 'https://search.azure.com' | |
| param customSearchResourceUrl string = cloudEnvironment == 'usgovernment' | |
| ? 'https://search.azure.us' | |
| : (cloudEnvironment == 'public' ? 'https://search.azure.com' : '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value logic for cloudEnvironment uses nested ternary expressions that check az.environment().name for 'AzureCloud' and 'AzureUSGovernment', mapping them to 'public' and 'usgovernment' respectively, with 'custom' as the fallback. However, if az.environment().name returns other known Azure cloud names like 'AzureChinaCloud' or 'AzureGermanCloud', they would incorrectly be mapped to 'custom' instead of having their own handling. Consider explicitly handling all known Azure cloud types or documenting that only these three cloud types are supported.